* IFC importer progress
* Fix broken tests after Ingestion state changes
* Tests
* final tweaks
* add timeout to ModelIngestionCreateInput
* print timing in seconds
* default to None
* small tweak
* fix test
* Fix other tests
* Add progress transport
* allow empty affected objects
* adds unit tests for `attach_result_to_objects` method
Introduces tests for handling empty object lists and objects with IDs.
Enhances error handling for cases where objects lack IDs, ensuring robustness in the functionality.
Confirms that the method correctly appends results under various scenarios.
* line length
* Update test cases for StreamWrapper URLs
* Update branch name in StreamWrapper test
* Update project URLs in test_wrapper.py
* Uncomment URLs in test_to_string function
Uncommented specific URLs in the test case to enable testing.
* ifc metrics
* add http server tests for metrics
* clean up tests
* change back to localhost:3000
* comment
* renamed wrapper for clarity
* fix unrelated model_ingestion
* First pass
* add tests
* Add cancellation
* fix
* status changes
* fixes
* test fixes
* tests(subscriptions): fix model ingestion tests
* feat(modelingestion): rename resource and add some more tests
* feat(ifcimport): use new modelingestion api
* feat: wrap up new ingestion
* fix: model ingestion payload and test server url
* fix: test port was 3000
* fix: remove version message from model ingestion success input
* fix: test subs cancelled
* ci: signal public of private envv in ci
---------
Co-authored-by: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com>
make sure the automate metrics are attributed to automate host app use
the version metrics to report the version received into automate.
Co-authored-by: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com>
* updated path
* Add chaining
* debugging deploy
* docs added
* revert back
* disable mise
* feat: use mise for docs build
* fix: netlify do not tripple quote
* ci: netlify use mise
* ci: just run build
---------
Co-authored-by: Mike Tasset <mike.tasset@gmail.com>
Co-authored-by: Gergo Jedlicska <gergo@jedlicska.com>
* first pass
* round2
* experiments
* Moved docs one layer higher
* docs poc
* re-lock
* created docs
* some ci work
* updated toml
* ruff version update
* update toml
* docs group
---------
Co-authored-by: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com>
* First pass
* Add applicationId for proxyInstance
* renamed revit instances
* renamed collection again
* again
* reverted main changes for manual testing
* small refactor of function def
* format matix
* add qtos
* cleanup
* add units first pass
* module cache for project units
* quantity field unit cache
* quantity extraction py
* comm cleanup
* cache by field name
* simplify get quantities
* take only what you need
* move unit mapping to module level
* function call elimination
* early return ifc quantities
* final touches (hopefully)
* second pass
* fixed mistake
* fix
* little optimisation
* reset main back to before
---------
Co-authored-by: bimgeek <mucahitbgoker@gmail.com>
* feat: add file import resource with complete job handling support
* fix: include the file import resource in the core client too
* feat: integrate with server side parser app
* chore: fix pr comments and make docker compose work with new object
storage
* chore: fix test compose file readiness probe
* Initial commit
* Repo setup
* first working version
* Optimised mesh conversion
* timers
* first pass
* format
* Format
* deleted old file
* Working grabbing spatial elements, but not all relationships captured
* DFS for spatials, itterator for geometry
* Second pass, manual traversal
* Ok, this is working nicely now
* Cleanup
* Convert render materials
* property set extraction (#2)
* various changes (#4)
* Fix for non-app.speckle.systems servers (#5)
* don't use https for http server urls (#6)
* fix(conversion): Filter only IfcRoot classes (#7)
* Filter only IfcRoot classes
* vscode config
* Feat(prop): Added better property extraction (#8)
* Added better property extraction
* property sets naming
* feat: attach attributes that are on the element type level (#9)
* Added better property extraction
* property sets naming
* Get attributes from element type
* tidy up (#10)
* Add null check (#11)
* ruff (#12)
* Rendermaterials inherit material names instead of type + unique id (#14)
* lock
* ruff check
* pre-commit
* add license files for the speckleifc subpackage
---------
Co-authored-by: Sebastian Witt <sebastian.witt@rwth-aachen.de>
Co-authored-by: Gergő Jedlicska <57442769+gjedlicska@users.noreply.github.com>
Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
Pydantic is a validation and parsing library, its supposed to sit at the edge of apps, to make sure the data transferred in and out is valid. Its not meant to be a generic python base class.
* fix(ci): Initial test with new docker-compose file
* fix(ci): Don't use python orb
* fix(ci): Use python 3
* fix(ci): Use python3 everywhere
* fix(ci): whitespace PEBKAC
* fix(ci): use included pyenv installation
* fix(ci): Skip pyenv version if its the current one
* fix(ci): Reapply matrix build for integration testing
* fix(ci): Run exec $SHELL
* fix(ci): Removed exec step
* fix(ci): Remove test-old job
For the SectionProfile, a separate static variable e.g. STRUCTURAL_PROFILE could be created later, I now just made an easy fix.
For the enumeration attributes, I believe they should be integer, as e.g. Revit pushes them as integers, not strings.
* fix(metrics): log ex as debug for jupyter notebook
so apparently in jupyter notebooks this will actually throw
unlike in a regular python environment.
changing severity to debug since no one should ever care except me
when i'm debugging lol!
* fix(metrics): another log level change
* Initial commit
* Create CODE_OF_CONDUCT.md
* Create CONTRIBUTING.MD
* Update CODE_OF_CONDUCT.md
adds authoritative source notice to this repo
* Create ISSUE_TEMPLATE.md
* Update CODE_OF_CONDUCT.md
* Update and rename CONTRIBUTING.MD to CONTRIBUTING.md
* Update README.md
adds basic default social badges - discourse and twitter
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Create LICENSE
* Update README.md
* Update README.md
* Update CONTRIBUTING.md
fixes link
* Update CODE_OF_CONDUCT.md
* docs: add slack link and badge
* Update README.md
* fix: link and typos
* fix: more links
* refactor: moved files to .github/ folder
* feat: added PR template
Updated docs to reflect it.
* fix: updated old link
* fix: added yaml frontmatter block to issue template
* docs: removes links to slack
* docs: adds link to docs
* Update README.md
* Create open-issue.yml
* Create close-issue.yml
* Fixes: PR template updated to provide detailed instructions
* Add link to speckle-server contribution guide
* Fix link to relative to the repo pull requests
* Feature: separates issue template into bugs and feature requests
* Provides checklist for both issue templates
* Hides instructions in comments
* Add link to contribution guidelines
* Retain some sections from previous issue template
* checklist is clearer
* style: tidy newlines and other small formatting
* Add a SECURITY.md file
* Refer to the code of conduct in the contributing section of the README
* chore(pr_template): adds a reference section to the PR template
The SpecklePY PR template had a reference section, and it made sense to include it for all
repositories.
* Remove redundant issue template
* fix(pull request template): pR template should be the default and not an option
PR template was in a directory which allows selection using queries. The PR template should be
provided by default so should be renamed and placed in the .github directory.
Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
Co-authored-by: izzy lyseggen <izzy.lyseggen@gmail.com>
Co-authored-by: Matteo Cominetti <matteo@cominetti.org>
Co-authored-by: Alan Rynne <alan@speckle.systems>
Co-authored-by: Alan Rynne <alan@rynne.es>
Co-authored-by: Matteo Cominetti <matteo@speckle.systems>
so apparently in jupyter notebooks this will actually throw
unlike in a regular python environment.
changing severity to debug since no one should ever care except me
when i'm debugging lol!
* chore: update dev container
* feat(client): add server version request
* docs(client): enhanced server version docstring
* test(client): sever version test
* test(base): type check for union type
* refactor(base): move _ attrs to `RegisteringBase`
* refactor: some light cleanup
* chore(container): add pylint line length
* feat(metrics): add "Invite Action"
* feat(client): pass server version to resources
* feat(models): pending stream collaborator model
* fix(client): do not parse if request res is null
* feat(exceptions): add unsupported exception
to distinguish for new invites as of server 2.6.4
* feat(client): add stream invite queries/mutations
* test(client): test stream invites
* feat(client): incorporate last invites changes
* feat(serialization): cache bases on deserialize
allows the deserializer to return the same instance when encountering
objects with the same id
closes#191
* feat(serialization): cache bases on deserialize
allows the deserializer to return the same instance when encountering
objects with the same id
closes#191
* fix(serialization): check before accessing id
obj may not be detached and therefore might not have an id
* feat(serializer): cache w id from obj not base
* chore: update deps
* feat(operations): lil send helper
on send, if `transports` is just a transport, add it to a list.
i see this error a lot so just a friendly lil fix!
* feat(objects): breps omg!
* test(geometry): updates for breps
* test(geometry): more brep serialization tests
* refactor(test): formatting
* style: formatting
* test(geometry): clean up test file
* fix(test): brep trims test fix
* refactor(geometry): clean up encoding outputs
* feat(objects): allow kwargs in encoding
* feat(objects): align curve encodings w sharp
* test(geometry): new curve encodings
* feat(client): update stream permission mutation
guess this changed some time recently and i wasn't made aware of it
* fix(objects): brep face and edge encoding
* fix(geometry): breps units 'none' fix
* test(objects): fix 'none' units issue
* revert(486ea99): use `streamGrantPermission`
to be updated for next server release
Sorts the serializable attributes before they are returned from
.get_serializable_attributes(). Prevents the object id to change if the
order of the member names from .get_member_names() changes.
* feat(metrics): add `merge_ids` helper method
* fix(metrics): use alias ids instead
* fix(metrics): final cleanup for aliasing
* fix(metrics): lol jk scratch the aliasing
* chore: depreciate python 3.6 support & upate ujson
after collection python version info metrics, we fount that only 2 users
are still using python 3.6. since it has been eol for 5 months now,
we believe it's safe to let it go.
rest easy 3.6 ⚰✨- you served us well 🫡
closes Please upgrade the ujson dependency, which has a CVE #160
* chore: upgrade and clean some deps
### SUMMARY
**sqlite transport**
This transport now batches and bulk inserts objects when writing resulting in huge performance improvements (100x).
**base object serializer**
Batching in the sqlite transport necessitated some refactoring here in order to safely call end_write when not using operations.send/receive. This has been resolved by turning traverse_base into a wrapper for _traverse_base which can take care of calling begin/end_write and resetting the writer at the top level. This is not breaking since the top level methods to call have not changed names and the original method has just been prepended with a _
Additionally, missing referenced child objects in the read transport used to raise a SpeckleException. However, using the gql client to call objects.get() will return an object with missing references by design thus throwing an error in serialization. This has been resolved by instead raising a SpeckleWarning when child objects can't be found and just returning the reference + id. ((this method of interacting with objects is discouraged so it is not surprising to me that this bug was lurking for so long - but an oopsie nonetheless!))
**ci / dev**
Updates for the ci config and the dev container to work with the recent changes in server.
NOTE: dev container seems to be pulling an older version of server -- not resolved yet
---
* quick and hacky sqlite batching
* feat(transports): batching sqlite inserts
* chore: upgrade gql3
also removed py-spy as it's not used and i was getting install errors :/
* ci: bump node version
* ci: formatting
* update CI versions
* update to new circleci redis baseimage
* update test fixture auth to non deprecated token based method
* add start and finish write method calls to base object serialize
* chore: dev container update
* fix(serialization): move end and begin write
* style: formatting
* fix(serializer): warn but don't throw if ref not found
this is _not_ an issue with the transports, but an issue with using the
graphql api to fetch objects. since you are only receiving one obj and none of
the children, the transport has no way to find them and should simply
return the reference as is. idk why anyone would really use `object.get`
so tbh i'm not surprised no one has found this bug yet lol
* fix(client): don't parse obj create response
* fix(serializer): wrap `traverse_base`
moving `begin` and `end_write` to the seriazlier due to the new
sqlite transport with batched writes necessitates a wrapper around
`traverse_base` so end/begin write can be called once at the top level.
just adding begin/end write to the original traversal method would make
tons of calls to `end_write` since the traversal is recursive
Co-authored-by: izzy lyseggen <izzy.lyseggen@gmail.com>
* feat(models): a quickie lil update
- adds fave and comment count
(mutations to come)
- adds source app to commit within stream query
* feat(client): add favorite mutation
- add metrics for client init / auth
- add server metrics
- remove incompatible server check in client
(at this point, it's been long enough that I think it's fine and will
save time on request / esp in places like blender)
* fix(geometry): int(index vals) for curve encoding
* fix(client): update poss invalid token check
server now returns `None` instead of a `GraphqlExcetion` when asking for
the user with an invalid token (or no scopes token)
* feat(models): `ActivityCollection` and `Activity`
* feat(client): stream activity method
* test(client): test for stream activity
* refactor(client): use datetime args for activity
* docs(client): clean up stream activity docstring
* feat/test(client): user activity
objects were being split on non-english characters causing receive fails
will also get fixed server side, but this will act as a double check
and an immediate fix for people dealing with this now
This makes it easier to develop and run tests against an environment that has the right python virtualenv + a local speckle server + postgres + redis instance
closes#139
realised that this doesn't really apply to py since acct is set
automatically by looking for the right server url, but have made this
more explicit by making the acct and client "private"
@Reynold-Chan please use Black for code formatting to keep the style
consistent with the rest of the repo. you can set your editor to
automatically format on save
- also improves performance by moving adding chunkables/detachables to
the init_subclass hook
- all inits in the geo classes have been removed
- type checking is enforced on setting attributes from the `Base` class
- unrecognised types are ignored (no type checking)
- generics are checked for the generic only, not for the args
- ints and strs are attempted to be parsed as floats,
but not the other way around
so i'm a bit of a dumbo here.
i didn't realise that doing `.update()` on attr would update the parent
attr as well and extend to all objects every ahhhhhh
you have to do `self.thing = self.thing + blah blah` to just update
the instance attr. the more ya know!
#roastme @cristi8
Implement automatic type register mechanism that stores all speckle Base model subclasses in a type
register for deserialization reuse in transports. This enables the Base to be useful as a base kit
object.
fix#50
It was possible to override the builint types with a duplicate speckle_type, either via a duplicate
class name of an explicit speckle_type definition. It is now checked before registering the new type
in the subclass registry, and a meaningful error is thrown.
It was possible to override the builint types with a duplicate speckle_type, either via a duplicate
class name of an explicit speckle_type definition. It is now checked before registering the new type
in the subclass registry, and a meaningful error is thrown.
#50
Thank you for reading this! Speckle's a rather wide network of parts that depend on each other, either directly, indirectly or even just cosmetically.
@@ -9,41 +10,41 @@ This means that what might look like a simple quick change in one repo may have
## Bugs & Issues 🐞
### Found a new bug?
### Found a new bug?
- First step is to check whether this is a new bug! We encourage you to search through the issues of the project in question **and** associated repos!
- If you come up with nothing, **open a new issue with a clear title and description**, as much relevant information as possible: system configuration, code samples & steps to reproduce the problem.
- If you come up with nothing, **open a new issue with a clear title and description**, as much relevant information as possible: system configuration, code samples & steps to reproduce the problem.
- Can't mention this often enough: tells us how to reproduce the problem! We will ignore or flag as such issues without reproduction steps.
- Can't mention this often enough: tells us how to reproduce the problem! We will ignore or flag as such issues without reproduction steps.
- Try to reference & note all potentially affected projects.
### Sending a PR for Bug Fixes
You fixed something! Great! We hope you logged it first :) Make sure though that you've covered the lateral thinking needed for a bug report, as described above, also in your implementation! If there any tests, make sure they all pass. If there are none, it means they're missing - so add them!
You fixed something! Great! We hope you logged it first :) Make sure though that you've covered the lateral thinking needed for a bug report, as described above, also in your implementation! If there any tests, make sure they all pass. If there are none, it means they're missing - so add them!
## New Features 🎉
The golden rule is to Discuss First!
- Before embarking on adding a new feature, suggest it first as an issue with the `enhancement` label and/or title - this will allow relevant people to pitch in
- We'll now discuss your requirements and see how and if they fit within the Speckle ecosystem.
- The last step is to actually start writing code & submit a PR so we can follow along!
- All new features should, if and where possible, come with tests. We won't merge without!
- We'll now discuss your requirements and see how and if they fit within the Speckle ecosystem.
- The last step is to actually start writing code & submit a PR so we can follow along!
- All new features should, if and where possible, come with tests. We won't merge without!
> Many clients may potentially have overlapping scopes, some features might already be in dev somewhere else, or might have been postponed to the next major release due to api instability in that area. For example, adding a delete stream button in the accounts panel in rhino: this feature was planned for speckle admin, and the whole functionality of the accounts panel in rhino is to be greatly reduced!
## Cosmetic Patches ✨
Changes that are cosmetic in nature and do not add anything substantial to the stability or functionality of Speckle **will generally not be accepted**.
Changes that are cosmetic in nature and do not add anything substantial to the stability or functionality of Speckle **will generally not be accepted**.
Why? However trivial the changes might seem, there might be subtle reasons for the original code to be as it is. Furthermore, there are a lot of potential hidden costs (that even maintainers themselves are not aware of fully!) and they eat up review time unncessarily.
> **Examples**: modifying the colour of an UI element in one client may have a big hidden cost and need propagation in several other clients that implement a similar ui element. Changing the default port or specifiying `localhost` instead of `0.0.0.0` breaks cross-vm debugging and developing.
> **Examples**: modifying the colour of an UI element in one client may have a big hidden cost and need propagation in several other clients that implement a similar ui element. Changing the default port or specifiying `localhost` instead of `0.0.0.0` breaks cross-vm debugging and developing.
## Wrap up
Don't worry if you get things wrong. We all do, including project owners: this document should've been here a long time ago. There's plenty of room for discussion either on our community [forum](https://discourse.speckle.works) or [chat](https://speckle-works.slack.com/join/shared_invite/enQtNjY5Mzk2NTYxNTA4LTU4MWI5ZjdhMjFmMTIxZDIzOTAzMzRmMTZhY2QxMmM1ZjVmNzJmZGMzMDVlZmJjYWQxYWU0MWJkYmY3N2JjNGI).
Don't worry if you get things wrong. We all do, including project owners: this document should've been here a long time ago. There's plenty of room for discussion on our community [forum](https://discourse.speckle.works).
If it's your first time here - or you forgot about them - make sure you read the [contribution guidelines](CONTRIBUTING.md), and then feel free to delete this line!
### Expected vs. Actual Behavior
Describe the problem here.
### Reproduction Steps & System Config (win, osx, web, etc.)
Let us know how we can reproduce this, and attach relevant files (if any).
### Proposed Solution (if any)
Let us know what how you would solve this.
#### Optional: Affected Projects
Does this issue propagate to other dependencies or dependents? If so, list them here!
Provide a short summary in the Title above. Examples of good Issue titles:
* "Bug: Error from server when reticulating splines"
* "Bug: Revit crashes when installing connector"
-->
## Prerequisites
<!---
Please answer the following questions before submitting an issue.
-->
- [ ] I read the [contribution guidelines](https://github.com/specklesystems/speckle-server/blob/main/CONTRIBUTING.md)
- [ ] I checked the [documentation](https://speckle.guide/) and found no answer.
- [ ] I checked [existing issues](../issues?q=is%3Aissue) and found no similar issue. <!-- If you do find an existing issue, please show your support by liking it :+1: instead of creating a new issue -->
- [ ] I checked the [community forum](https://speckle.community/) for related discussions and found no answer.
- [ ] I'm reporting the issue to the correct repository (see also [speckle-server](https://github.com/specklesystems/speckle-server), [speckle-sharp](https://github.com/specklesystems/speckle-sharp), [specklepy](https://github.com/specklesystems/specklepy), [speckle-docs](https://github.com/specklesystems/speckle-docs), and [others](https://github.com/orgs/specklesystems/repositories))
## What package are you referring to?
<!---
Is it related to the server (backend) only, or does this bug relate to the frontend, viewer, objectloader or any other package?
-->
## Describe the bug
<!---
A clear and concise description of what the bug is.
-->
## To Reproduce
<!---
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->
## Expected behavior
<!---
A clear and concise description of what you expected to happen.
-->
## Screenshots
<!---
If applicable, add screenshots to help explain your problem.
-->
## System Info
If applicable, please fill in the below details - they help a lot!
### Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
### Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
## Failure Logs
<!---
Please include any relevant log snippets or files here, or upload as a file.
If including inline, please use markdown code block syntax. https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks
For example:
```
your log output here
```
-->
## Additional context
<!---
Add any other context about the problem here.
-->
## Proposed Solution (if any)
<!---
Let us know what how you would solve this.
-->
#### Optional: Affected Projects
<!---
Does this issue propagate to other dependencies or dependents? If so, list them here with links!
Provide a short summary in the Title above. Examples of good Issue titles:
* "Enhancement: Connector for Minecraft"
* "Enhancement: Web viewer should support tesseracts"
-->
## Prerequisites
<!---
Please answer the following questions before submitting an issue.
-->
- [ ] I read the [contribution guidelines](https://github.com/specklesystems/speckle-server/blob/main/CONTRIBUTING.md)
- [ ] I checked the [documentation](https://speckle.guide/) and found no answer.
- [ ] I checked [existing issues](../issues?q=is%3Aissue) and found no similar issue. <!-- If you do find an existing issue, please show your support by liking it :+1: instead of creating a new issue -->
- [ ] I checked the [community forum](https://speckle.community/) for related discussions and found no answer.
- [ ] I'm requesting the feature to the correct repository (see also [speckle-server](https://github.com/specklesystems/speckle-server), [speckle-sharp](https://github.com/specklesystems/speckle-sharp), [specklepy](https://github.com/specklesystems/specklepy), [speckle-docs](https://github.com/specklesystems/speckle-docs), and [others](https://github.com/orgs/specklesystems/repositories))
## What package are you referring to?
<!---
Is it related to the server (backend) only, or does this feature request relate to the frontend, viewer, objectloader or any other package?
-->
## Is your feature request related to a problem? Please describe.
<!---
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-->
## Describe the solution you'd like
<!---
A clear and concise description of what you want to happen.
-->
## Describe alternatives you've considered
<!---
A clear and concise description of any alternative solutions or features you've considered.
-->
## Additional context
<!---
Add any other context or screenshots about the feature request here.
Have you seen this feature implemented in any other software? Can you provide screenshots or links to video or documentation?
What works well about these existing features in other software? What doesn't work well?
-->
## Related issues or community discussions
<!---
Is this feature request related to (but sufficiently distinct from) any existing issues?
Does this feature request require other features to be available beforehand?
Has this feature been discussed in the community forum, please link here? https://speckle.community/
Provide a short summary in the Title above. Examples of good PR titles:
* "Feature: adds metrics to component"
* "Fix: resolves duplication in comment thread"
* "Update: apollo v2.34.0"
-->
## Description & motivation
<!---
Describe your changes, and why you're making them. What benefit will this have to others?
Is this linked to an open Github issue, a thread in Speckle community,
or another pull request? Link it here.
If it is related to a Github issue, and resolves it, please link to the issue number, e.g.:
Fixes #85, Fixes #22, Fixes username/repo#123
Connects #123
-->
## Changes:
<!---
- Item 1
- Item 2
-->
## To-do before merge:
<!---
(Optional -- remove this section if not needed)
Include any notes about things that need to happen before this PR is merged, e.g.:
- [ ] Change the base branch
- [ ] Ensure PR #56 is merged
-->
## Screenshots:
<!---
Include a screenshot the before and after. This can be a screenshot of a plugin, web frontend, or output in a terminal.
-->
## Validation of changes:
<!---
Describe what tests have been added or amended, and why these demonstrate it works and will prevent this feature being accidentally broken by future changes.
-->
## Checklist:
<!---
This checklist is mostly useful as a reminder of small things that can easily be
forgotten – it is meant as a helpful tool rather than hoops to jump through.
Put an `x` between the square brackets, e.g. [x], for all the items that apply,
make notes next to any that haven't been addressed, and remove any items that are not relevant to this PR.
-->
- [ ] My pull request follows the guidelines in the [Contributing guide](https://github.com/specklesystems/speckle-server/blob/main/CONTRIBUTING.md)?
- [ ] My pull request does not duplicate any other open [Pull Requests](../../pulls) for the same update/change?
- [ ] My commits are related to the pull request and do not amend unrelated code or documentation.
- [ ] My code follows a similar style to existing code.
- [ ] I have added appropriate tests.
- [ ] I have updated or added relevant documentation.
## References
<!---
(Optional -- remove this section if not needed )
Include **important** links regarding the implementation of this PR.
This usually includes a RFC or an aggregation of issues and/or individual conversations
that helped put this solution together. This helps ensure we retain and share knowledge
regarding the implementation, and may help others understand motivation and design decisions etc..
> Speckle is the first AEC data hub that connects with your favorite AEC tools. Speckle exists to overcome the challenges of working in a fragmented industry where communication, creative workflows, and the exchange of data are often hindered by siloed software and processes. It is here to make the industry better.
> ⚠ This is the start of the Python client for Speckle 2.0. It is currently quite nebulous and may be trashed and rebuilt at any moment! It is compatible with Python 3.6+ ⚠
Send and receive data from a Speckle Server with `operations`, interact with the Speckle API with the `SpeckleClient`, create and extend your own custom Speckle Objects with `Base`, and more!
Head to the [**📚 specklepy docs**](https://speckle.guide/dev/python.html) for more information and usage examples.
## Developing & Debugging
To get started, create a virtual environment and pip install the requirements.
### Installation
on windows:
```
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
```
This project uses uv for dependency management, make sure you follow the official [docs](https://docs.astral.sh/uv/) to get it.
on mac:
To create a new virtual environment with uv run `$ uv venv` and follow the instructions on the screen to activate the virtual environment.
To bootstrap the project environment run `$ uv sync`. This will install both the package and dev dependencies.
```
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```
To execute any python script run `$ uv run python my_script.py`
> Alternatively you may roll your own virtual-env with either venv, virtualenv, pyenv-virtualenv etc. Uv will play along an recognize if it is invoked from inside a virtual environment.
### Style guide
## Overview of functionality
All our repo wide styling linting and other rules are checked and enforced by `pre-commit`, which is included in the dev dependencies.
It is recommended to set up `pre-commit` after installing the dependencies by running `$ pre-commit install`.
Commiting code that doesn't adhere to the given rules, will fail the checks in our CI system.
The `SpeckleClient` is the entry point for interacting with the GraphQL API. You'll need to have a running server to use this.
The `BaseObjectSerializer` is used for decomposing and serializing `Base` objects so they can be sent / received to the server. You can use it directly to get the id (hash) and a serializable object representation of the decomposed `Base`. You can learn more about the Speckle `Base` object [here](https://discourse.speckle.works/t/core-2-0-the-base-object/782) and the decomposition API [here](https://discourse.speckle.works/t/core-2-0-decomposition-api/911).
```py
detached_base=Base()
detached_base.name="this will get detached"
base_obj=Base()
base_obj.name="my base"
base_obj["@nested"]=detached_base
serializer=BaseObjectSerializer()
hash,obj_dict=serializer.traverse_base(base_obj)
```
If you use the `operations`, you will not need to interact with the serializer directly as this will be taken care of for you. You will just need to provide a transport to indicate where the objects should be sent / received from. At the moment, just the `MemoryTransport` and the `ServerTransport` are fully functional at the moment. If you'd like to learn more about Transports in Speckle 2.0, have a look [here](https://discourse.speckle.works/t/core-2-0-transports/919).
```py
transport=MemoryTransport()
# this serialises the object and sends it to the transport
This doc is not complete - there's more to see so have a dive into the code and play around! Please feel free to provide feedback, submit issues, or discuss new features ✨
- Windows: `APPDATA` or `<USER>\AppData\Roaming\Speckle`
- Linux: `$XDG_DATA_HOME` or by default `~/.local/share/Speckle`
- Mac: `~/.config/Speckle`
## Contributing
Please make sure you read the [contribution guidelines](.github/CONTRIBUTING.md) for an overview of the best practices we try to follow.
Please make sure you read the [contribution guidelines](.github/CONTRIBUTING.md) and [code of conduct](.github/CODE_OF_CONDUCT.md) for an overview of the practices we try to follow.
## Community
The Speckle Community hangs out in two main places, usually:
The Speckle Community hangs out on [the forum](https://discourse.speckle.works), do join and introduce yourself & feel free to ask us questions!
- on [the forum](https://discourse.speckle.works)
- on [the chat](https://speckle-works.slack.com/join/shared_invite/enQtNjY5Mzk2NTYxNTA4LTU4MWI5ZjdhMjFmMTIxZDIzOTAzMzRmMTZhY2QxMmM1ZjVmNzJmZGMzMDVlZmJjYWQxYWU0MWJkYmY3N2JjNGI)
## Security
Do join and introduce yourself!
For any security vulnerabilities or concerns, please contact us directly at security[at]speckle.systems.
Hi! If you've found something off, we'd be more than happy if you would report it via security@speckle.systems. We will work together with you to correctly identify the cause and implement a fix. Thanks for helping make Speckle safer!
> The Python SDK for Speckle - Build powerful AEC data workflows
**specklepy** is the Python SDK for Speckle, enabling you to interact with Speckle Server, send and receive geometry, and build custom integrations for the AEC industry.
## What is specklepy?
specklepy is a comprehensive Python library that provides:
* **Object-based data exchange** - Send and receive geometry and BIM data without files
* **GraphQL API client** - Full access to Speckle Server's API
* **Extensible object model** - Create custom objects that inherit from `Base`
* **Multiple transport options** - Store data locally (SQLite), in-memory, or on Speckle Server
Speckle Automate is a fully fledged CI/CD platform designed to run custom code on Speckle models whenever a new version is available.
As a software developer, you can develop Functions that others in your team consume in Automations. From creating reports to running code compliance checks to wind simulations, there is no limit to what you can do with Automate.
Create a new object on a stream. To send a base object, you can prepare it by running it through the `BaseObjectSerializer.travers_base` function to get a valid (serialisable) object to send.
NOTE: this does not create a commit - you can create one with `SpeckleClient.commit.create`.
Arguments:
stream_id {str} -- the id of the stream you want to send the object to
objects {List[Dict]} -- a list of base dictionary objects (NOTE: must be json serialisable)
"""Subscribes to stream removed event for your profile. Use this to display an up-to-date list of streams for your profile. NOTE: If someone revokes your permissions on a stream, this subscription will be triggered with an extra value of revokedBy in the payload.
Arguments:
callback {Callable[Dict]} -- a function that takes the returned dict as an argument and executes each time a stream is removed
Returns:
dict -- dict containing 'id' of stream removed and optionally 'revokedBy'
"""
query=gql(
"""
subscription { userStreamRemoved }
"""
)
returnawaitself.subscribe(
query=query,
callback=callback,
return_type="userStreamRemoved",
parse_response=False,
)
@check_wsclient
asyncdefsubscribe(
self,
query:gql,
params:Dict=None,
callback:Callable=None,
return_type:strorList=None,
schema=None,
parse_response:bool=True,
):
# if self.client.transport.websocket is None:
# TODO: add multiple subs to the same ws connection
"""Gets the profile of a user. If no id argument is provided, will return the current authenticated user's profile (as extracted from the authorization header).
Returns all the publicly available apps on this server.
"""
apps:[ServerAppListItem]
}
typeServerApp{
id:String!
secret:String!
name:String!
description:String
termsAndConditionsLink:String
logo:String
public:Boolean
trustByDefault:Boolean
author:AppAuthor
createdAt:DateTime!
redirectUrl:String!
scopes:[Scope]!
}
typeServerAppListItem{
id:String!
name:String!
description:String
termsAndConditionsLink:String
logo:String
author:AppAuthor
}
typeAppAuthor{
name:String
id:String
}
extendtypeUser{
"""
Returns the apps you have authorized.
"""
authorizedApps:[ServerAppListItem]
@hasRole(role:"server:user")
@hasScope(scope:"apps:read")
"""
Returns the apps you have created.
"""
createdApps:[ServerAppListItem]
@hasRole(role:"server:user")
@hasScope(scope:"apps:read")
}
extendtypeMutation{
"""
Register a new third party application.
"""
appCreate(app:AppCreateInput!):String!
@hasRole(role:"server:user")
@hasScope(scope:"apps:write")
"""
Update an existing third party application. **Note: This will invalidate all existing tokens, refresh tokens and access codes and will require existing users to re-authorize it.**
"""
appUpdate(app:AppUpdateInput!):Boolean!
@hasRole(role:"server:user")
@hasScope(scope:"apps:write")
"""
Deletes a thirty party application.
"""
appDelete(appId:String!):Boolean!
@hasRole(role:"server:user")
@hasScope(scope:"apps:write")
"""
Revokes (de-authorizes) an application that you have previously authorized.
"""
appRevokeAccess(appId:String!):Boolean
@hasRole(role:"server:user")
@hasScope(scope:"apps:write")
}
inputAppCreateInput{
name:String!
description:String!
termsAndConditionsLink:String
logo:String
public:Boolean
redirectUrl:String!
scopes:[String]!
}
inputAppUpdateInput{
id:String!
name:String!
description:String!
termsAndConditionsLink:String
logo:String
public:Boolean
redirectUrl:String!
scopes:[String]!
}
,extendtypeServerInfo{
"""
The authentication strategies available on this server.
The full object, with all its props & other things. **NOTE:** If you're requesting objects for the purpose of recreating & displaying, you probably only want to request this specific field.
"""
data:JSONObject
"""
Get any objects that this object references. In the case of commits, this will give you a commit's constituent objects.
**NOTE**: Providing any of the two last arguments ( `query`, `orderBy` ) will trigger a different code branch that executes a much more expensive SQL query. It is not recommended to do so for basic clients that are interested in purely getting all the objects of a given commit.
# User bound subscriptions that operate on the stream collection of an user
# Example relevant view/usecase: updating the list of streams for a user.
#
"""
Subscribes to new stream added event for your profile. Use this to display an up-to-date list of streams.
**NOTE**: If someone shares a stream with you, this subscription will be triggered with an extra value of `sharedBy` in the payload.
"""
userStreamAdded:JSONObject
@hasRole(role:"server:user")
@hasScope(scope:"profile:read")
"""
Subscribes to stream removed event for your profile. Use this to display an up-to-date list of streams for your profile.
**NOTE**: If someone revokes your permissions on a stream, this subscription will be triggered with an extra value of `revokedBy` in the payload.
"""
userStreamRemoved:JSONObject
@hasRole(role:"server:user")
@hasScope(scope:"profile:read")
#
# Stream bound subscriptions that operate on the stream itself.
# Example relevant view/usecase: a single stream connector, or view, or component in a web app
#
"""
Subscribes to stream updated event. Use this in clients/components that pertain only to this stream.
"""
streamUpdated(streamId:String):JSONObject
@hasRole(role:"server:user")
@hasScope(scope:"streams:read")
"""
Subscribes to stream deleted event. Use this in clients/components that pertain only to this stream.
"""
streamDeleted(streamId:String):JSONObject
@hasRole(role:"server:user")
@hasScope(scope:"streams:read")
}
inputStreamCreateInput{
name:String
description:String
isPublic:Boolean
}
inputStreamUpdateInput{
id:String!
name:String
description:String
isPublic:Boolean
}
inputStreamGrantPermissionInput{
streamId:String!,
userId:String!,
role:String!
}
inputStreamRevokePermissionInput{
streamId:String!,
userId:String!
}
,extendtypeQuery{
"""
Gets the profile of a user. If no id argument is provided, will return the current authenticated user's profile (as extracted from the authorization header).
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.