Compare commits

..

717 Commits

Author SHA1 Message Date
Gergő Jedlicska fbbd6c0dd7 Merge pull request #303 from specklesystems/gergo/speckle_automate
feat: add speckle automate package with some basic sanity tests
2023-09-20 10:06:10 +02:00
Gergő Jedlicska 8ffe219111 chore: update deps 2023-09-19 20:22:57 +02:00
Gergő Jedlicska e4d087db3a fix: we still support py38 2023-09-19 20:21:46 +02:00
Gergő Jedlicska 2e8943e961 feat: test against latest 2023-09-19 20:18:47 +02:00
Gergő Jedlicska f254defc6b feat: add speckle automate package with some basic sanity tests 2023-09-19 20:11:32 +02:00
KatKatKateryna 948a56a07f Merge pull request #300 from specklesystems/2.16_backwards-compatibility
add deprecated gis classes
2023-09-18 13:07:19 +01:00
KatKatKateryna 3eed9a60fa add deprecated gis classes 2023-09-08 19:28:14 +01:00
Jedd Morgan c169c4eeda Merge pull request #299 from specklesystems/jrm/units/units-brep-fix
fix(objects)): Fixed issue where breps were incorrectly setting their…
2023-09-08 13:45:46 +01:00
Jedd Morgan 32b5ef88a1 fix(tests): fixed unit test for brep serialization 2023-09-08 13:43:50 +01:00
Jedd Morgan 3a979318ad fix(objects)): Fixed issue where breps were incorrectly setting their units 2023-09-07 17:33:01 +01:00
Gergő Jedlicska 1e6321c7f1 Merge pull request #296 from specklesystems/gergo/abstract_transport_no_pydantic
fix(AbstractTransport-and-subclasses): abstract transport and its subclasses should not be pydantic models
2023-09-07 13:26:47 +02:00
Gergő Jedlicska b5fb684864 Merge branch 'main' into gergo/abstract_transport_no_pydantic 2023-09-07 13:22:15 +02:00
Gergő Jedlicska 65048cd01b Merge pull request #290 from specklesystems/gergo/allowUnsupportedUnits
allow string units
2023-09-07 13:19:25 +02:00
Jedd Morgan 9d2fd5bc42 Merge branch 'main' into gergo/allowUnsupportedUnits 2023-09-07 12:17:19 +01:00
Jedd Morgan bd35fb59c3 Merge pull request #295 from specklesystems/jrm/unit-scale-factor
Unit scaling
2023-09-07 12:17:01 +01:00
Gergő Jedlicska 4931c95d7c Merge pull request #291 from specklesystems/2.16
2.16 - add classes for Topography and Tables without geometry
2023-09-07 13:15:16 +02:00
Gergő Jedlicska 52d53db661 fix(AbstractTransport-and-subclasses): abstract transport and its subclasses should not be pydantic models
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.
2023-09-06 13:43:05 +02:00
Jedd Morgan 23ee28f851 Merge branch 'gergo/allowUnsupportedUnits' into jrm/unit-scale-factor 2023-09-06 12:39:35 +01:00
Jedd Morgan 791190a38c Merge branch 'main' into gergo/allowUnsupportedUnits 2023-09-06 12:36:45 +01:00
Jedd Morgan 3c7feb0bec Merge branch 'main' into jrm/unit-scale-factor 2023-09-06 12:36:03 +01:00
Jedd Morgan 2b583fd822 Added unit scaling functions in units.py 2023-09-06 12:34:16 +01:00
KatKatKateryna 8244e3ecc7 remove redundant units 2023-09-06 11:31:54 +01:00
KatKatKateryna 5ac9d80cbc fix 2023-09-06 11:28:55 +01:00
KatKatKateryna 5e2fbaa7c2 replace init for GIS classes 2023-09-06 11:14:46 +01:00
KatKatKateryna 703ceaf369 naming 2023-09-05 15:02:47 +01:00
Gergő Jedlicska a5096c41ca Merge pull request #293 from specklesystems/metrics_rename
SDK Action metrics rename
2023-09-05 14:47:31 +02:00
Jedd Morgan 972339454d Update base.py 2023-09-05 12:50:11 +01:00
KatKatKateryna 34c11d5931 SDK Action 2023-09-05 09:51:36 +01:00
Jedd Morgan 854ce9f77f Merge branch 'main' into gergo/allowUnsupportedUnits 2023-09-04 21:02:54 +01:00
Jedd Morgan 7f926cf547 Merge pull request #292 from specklesystems/2.16-hotfixes
2.16 hotfixes
2023-09-04 21:02:37 +01:00
KatKatKateryna 5e8b54e3b7 import Core client by default 2023-09-04 20:09:57 +01:00
KatKatKateryna 8bd46e4e64 Revert "add metrics keyword for Connector Action"
This reverts commit 0cb6c7f682.
2023-09-04 19:57:36 +01:00
KatKatKateryna 91edd4f85b add metrics keyword for Connector Action 2023-09-04 19:57:16 +01:00
KatKatKateryna 0cb6c7f682 add metrics keyword for Connector Action 2023-09-04 16:17:48 +01:00
Gergő Jedlicska 125a4bbeed Merge pull request #288 from specklesystems/jrm/graph-traversal
feat: Added graph traversal
2023-08-31 16:05:54 +02:00
Jedd Morgan 76c4074aed Poetry lock 2023-08-31 15:05:19 +01:00
Jedd Morgan 16164a57da Merge branch 'main' into jrm/graph-traversal 2023-08-31 15:04:29 +01:00
Jedd Morgan 3a225fa935 attrs class 2023-08-31 15:01:59 +01:00
Gergő Jedlicska 102850b894 allow string units 2023-08-30 15:56:34 +02:00
KatKatKateryna 5ac85c541b add Topography class 2023-08-25 18:28:06 +01:00
Gergő Jedlicska cca7b18119 Merge pull request #289 from specklesystems/gergo/pydantic2
gergo/pydantic2
2023-08-14 11:42:28 +02:00
Gergő Jedlicska 8a34b95128 remove deprecated user resources 2023-08-14 11:41:37 +02:00
Gergő Jedlicska 46d7abbaee migrate away from deprecated pydantic method 2023-08-14 11:28:08 +02:00
Gergő Jedlicska 67e95caf5f Merge pull request #286 from mortenengen/upgrade-to-pydantic2
chore: upgrade to pydantic 2.0
2023-08-14 11:13:30 +02:00
Morten Engen 04532ed645 Add defaults to optional model fields in core 2023-08-01 12:45:11 +02:00
Morten Engen 7df175d9bb Replace deprecated model val methods in core 2023-08-01 12:44:11 +02:00
Morten Engen 3912fa8860 Merge branch 'main' into upgrade-to-pydantic2 2023-08-01 12:27:42 +02:00
KatKatKateryna 34de2928ae non-geometry GIS class 2023-07-28 13:56:09 +01:00
KatKatKateryna 8a91260887 Merge pull request #287 from specklesystems/2.15-hotfix
fully separate core metrics
2023-07-26 16:19:04 +01:00
KatKatKateryna 88eea00787 duplicate _init_resources to non-core (so the resources will also follow sdk-metrics) 2023-07-26 13:16:07 +01:00
KatKatKateryna c57d57c009 return user resource 2023-07-25 12:56:08 +01:00
KatKatKateryna 708e3329e3 reverted changes, user prop removed 2023-07-24 16:15:43 +01:00
KatKatKateryna f0e68845c0 Revert "might or might not be a good way to warn about no more accessible 'user' methods"
This reverts commit 1ef9b91e82.
2023-07-24 16:12:28 +01:00
KatKatKateryna 434a4376b3 Revert "redirect deprecated methods / methods with old variables set - to 'other_user'"
This reverts commit c99c25e848.
2023-07-24 16:12:23 +01:00
KatKatKateryna d701bedcc7 Revert "move deprecated methods to core"
This reverts commit 3962126b54.
2023-07-24 16:12:20 +01:00
KatKatKateryna 6238150bd5 Revert "typo"
This reverts commit 3e41e8cd8e.
2023-07-24 16:12:18 +01:00
KatKatKateryna 3e41e8cd8e typo 2023-07-24 15:43:57 +01:00
KatKatKateryna 3962126b54 move deprecated methods to core 2023-07-24 15:41:32 +01:00
KatKatKateryna c99c25e848 redirect deprecated methods / methods with old variables set - to 'other_user' 2023-07-24 13:50:28 +01:00
KatKatKateryna 1ef9b91e82 might or might not be a good way to warn about no more accessible 'user' methods 2023-07-24 13:29:00 +01:00
KatKatKateryna c0cfe1471a return import of internal function 2023-07-21 17:18:52 +01:00
KatKatKateryna da838280c3 naming convention, inefficient imports, deprecated methods 2023-07-21 16:32:38 +01:00
KatKatKateryna 681872e5ff typo 2023-07-17 17:58:49 +01:00
KatKatKateryna e11c41e0f8 fixing mixed attribute types 2023-07-17 17:48:16 +01:00
Jedd Morgan ec651a9237 traversal 2023-07-17 14:39:10 +01:00
KatKatKateryna ece957fb0f limit http response length 2023-07-12 13:51:10 +01:00
KatKatKateryna 5338d8ac0f displaying full error message on send 2023-07-12 13:19:45 +01:00
KatKatKateryna e36ea70e8a fully separate core metrics 2023-07-12 00:08:26 +01:00
Morten Engen edf2afaa89 Update poetry.lock 2023-07-07 13:45:45 +02:00
Morten Engen e0b1b272c0 Update pyproject.toml 2023-07-07 13:06:49 +02:00
Morten Engen 682e82057e Replace deprecated model validation methods 2023-07-07 13:05:24 +02:00
Morten Engen 473e5cfddb Store model config in model attribute 2023-07-07 13:04:46 +02:00
Morten Engen 03cd989165 Add defaults to optional model fields 2023-07-07 13:04:14 +02:00
KatKatKateryna 284d841a1e Merge pull request #285 from specklesystems/gergo/lockResourceExecution
fix(resource): make sure no threading contention with the client can happen
2023-06-30 20:45:54 +08:00
Gergő Jedlicska 668fc5131f fix(resource): make sure no threading contention with the client can happen 2023-06-30 14:42:23 +02:00
Jedd Morgan 64926bd41d Merge pull request #279 from specklesystems/kate/separate_metrics
Kate/separate metrics
2023-06-27 15:53:43 +01:00
Jedd Morgan 1c9b186ea5 Merge pull request #275 from ciga2011/main
Fix Pointcloud bugs in geometry.py
2023-06-26 15:54:19 +01:00
KatKatKateryna ed9f1ad818 rotation 2023-06-21 17:21:50 +01:00
KatKatKateryna b83c30a1c9 added offsets to crs class 2023-06-21 12:45:18 +01:00
Gergő Jedlicska c079342a55 Merge pull request #273 from mortenengen/limit-batch-length
Fix: limit number of objects per batch sent to server
2023-06-14 14:03:16 +02:00
Gergő Jedlicska 6aa29d9b30 Merge branch 'main' into limit-batch-length 2023-06-14 13:58:57 +02:00
KatKatKateryna f456e4ddbb rename 2023-06-13 17:53:03 +01:00
KatKatKateryna dcd13224d0 added native_units for Degrees 2023-06-13 17:48:03 +01:00
KatKatKateryna 06952a5991 more specific domain identification 2023-06-13 12:17:27 +01:00
KatKatKateryna 6049049813 fixed server_id 2023-06-12 20:05:47 +01:00
Alan Rynne 75b7d30bd6 Merge branch 'main' into kate/separate_metrics 2023-06-12 15:35:34 +02:00
Alan Rynne 19e26318fc fix(ci): Integration tests now use new docker-compose file (#283)
* 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
2023-06-09 11:46:03 +02:00
Matteo Cominetti 798dc7ff6a Merge pull request #282 from specklesystems/alan/ci/remove-github-actions
chore(ci): Remove old github actions from specklepy repo
2023-06-08 13:59:14 +01:00
Alan Rynne 0e4cff5904 chore(ci): Remove old github actions from specklepy repo 2023-06-08 10:53:02 +02:00
KatKatKateryna d1502c9072 add GIS classes 2023-06-02 20:03:45 +01:00
KatKatKateryna 869629e2a3 return var for unchanged classes 2023-06-02 19:31:35 +01:00
KatKatKateryna 48b98294fb remove constant var from a child class 2023-06-02 19:23:03 +01:00
KatKatKateryna 8205180e5d _untracked_receive referenced from core function 2023-06-02 13:27:25 +01:00
KatKatKateryna a2fd21f541 Metrics renamed to SDK Actions 2023-06-02 13:18:20 +01:00
KatKatKateryna 08ac76cf09 untracked API to Core 2023-06-01 23:48:04 +01:00
Gergő Jedlicska fbf19420fa Merge pull request #278 from specklesystems/gergo/structural_shape_type
fix(structural-properties): add missing ShapeType member
2023-05-30 18:11:42 +02:00
Gergő Jedlicska 44336addaf fix(structural-properties): add missing ShapeType member 2023-05-30 18:02:25 +02:00
ciga2011 43c9a9cace Update geometry.py
Pointcloud properties should be chunkable.
2023-05-11 16:07:58 +08:00
KatKatKateryna 99e9f773b8 Merge pull request #269 from specklesystems/objects/collections
Added collection object
2023-05-05 23:25:56 +08:00
KatKatKateryna 189a5847cf Update other.py 2023-05-05 15:12:00 +01:00
KatKatKateryna eb86b4881a Merge branch 'main' into objects/collections 2023-05-05 14:49:26 +01:00
KatKatKateryna 64fca5f280 Collections moved to Core 2023-05-05 14:48:26 +01:00
Morten Engen 784e9c1326 batch_sender: limit number of objects per batch 2023-04-18 15:13:39 +02:00
Gergő Jedlicska c7f5e0718b Merge pull request #267 from RobClaessensRHDHV/feature/suppress_type_error_during_type_check
Fix: also suppress TypeError during type checking.
2023-04-06 19:00:08 +02:00
908599 d2685c5cf5 Add unit tests for type validation of Union with float and dict. 2023-04-06 17:28:55 +02:00
908599 1b83e5a84b Merge branch 'main' of https://github.com/RobClaessensRHDHV/specklepy into feature/suppress_type_error_during_type_check 2023-04-06 17:10:18 +02:00
Gergő Jedlicska 77e09b9780 Merge pull request #266 from specklesystems/jrm/one-installer-for-all
Added Installer
2023-04-06 17:03:15 +02:00
Gergő Jedlicska 402f750200 Merge pull request #270 from specklesystems/gergo/fix_tests
gergo/fix tests
2023-04-06 17:02:11 +02:00
Gergő Jedlicska a43e7471a4 style(formatting): fix formatting issues 2023-04-06 16:57:44 +02:00
Gergő Jedlicska a4ed7ebb08 fix(integration-tests): fix integration tests 2023-04-06 16:56:21 +02:00
Jedd Morgan e7eb7c67a9 Added collection object 2023-04-06 14:14:29 +01:00
908599 d547cdaac0 Fix to also suppress TypeError during type checking.
This currently gives an error when float conversion is attempted with a non-numeric value.
2023-04-06 10:13:19 +02:00
Jedd Morgan 6f35c1bd20 Added Installer 2023-03-28 17:04:46 +01:00
Jedd Morgan 420c73f484 Merge pull request #265 from specklesystems/gergo/connector_install_path
feat(path-provider): add connector installation path helper
2023-03-28 13:47:56 +01:00
Gergő Jedlicska c2859475cc feat(path-provider): add connector installation path helper 2023-03-28 13:31:57 +02:00
Gergő Jedlicska 56e8d65e2b Merge pull request #264 from specklesystems/jsdbroughton-patch-1
fix: `invite_batch` failing where `emails` or `user_ids` is not provided
2023-03-22 18:32:41 +01:00
Jonathon Broughton 7885a6be8d fix: NoneType is not iterable 2023-03-21 17:46:16 +00:00
Jedd Morgan b19b85c9d1 Merge pull request #263 from specklesystems/jrm/instances
Updated instances to match sharp 2.13 changes
2023-03-21 13:12:50 +00:00
Jedd Morgan db4b2b7f87 Removed new collections class as we are not ready 2023-03-20 15:16:03 +00:00
Jedd Morgan 77916995bc Updated instances to match sharp 2.13 changes 2023-03-19 03:11:10 +00:00
Gergő Jedlicska 3dd56dc38e Merge pull request #260 from specklesystems/gergo/forward_ref_type
gergo/forward ref type
2023-02-15 20:48:55 +01:00
Gergő Jedlicska ae42bec1c3 style(formatting): rerun formatting 2023-02-15 19:21:48 +01:00
Gergő Jedlicska ea7baf8eb5 fix(type_checking): make sure forwardrefs blank pass type checking 2023-02-15 19:20:45 +01:00
Gergő Jedlicska 8352bb5c9a Merge pull request #257 from Knuttatutta/knuttatutta/add_axis_type
Fix: Add AxisType and fix its type in Axis
2023-02-01 15:27:34 +02:00
Gergő Jedlicska fc34b876fd Merge branch 'main' into knuttatutta/add_axis_type 2023-02-01 15:26:10 +02:00
Gergő Jedlicska 183993cfc5 Merge pull request #254 from RobClaessensRHDHV/feature/revit_analytical_to_specklepy_structural_fixes
Fix: Interoperability from Revit analytical to specklepy structural
2023-02-01 15:24:45 +02:00
Knuttatutta 9be3b4b93d Added AxisType in module init 2023-02-01 10:34:01 +01:00
Knuttatutta 0b14660115 Add AxisType, fix type in Axis 2023-02-01 10:16:13 +01:00
908599 68c4c682a0 Revert incorrect type hint change 2023-01-17 10:46:31 +01:00
908599 4f93ddcaf3 Update speckle_type of SectionProfile to match C#, update type hints with C# Enum values to int.
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.
2023-01-16 16:01:33 +01:00
Gergő Jedlicska e842f651b9 Merge pull request #253 from RobClaessensRHDHV/feature/structural_property_bugfix
Typo fix in properties.py
2023-01-16 13:53:44 +01:00
908599 7e1bec1aba Typo fix in properties.py 2023-01-16 11:39:41 +01:00
Gergő Jedlicska 1fb9a4f5fe Merge pull request #252 from specklesystems/gergo/set_type_fix
fix(typing-system): add set type into type validation
2023-01-11 16:10:28 +01:00
Gergő Jedlicska 1668c80bed fix(typing-system): add set type into type validation 2023-01-11 16:07:04 +01:00
Gergő Jedlicska ac6ba87c68 Merge pull request #251 from specklesystems/gergo/unionTriples
fix(type-validation): fix union types with more than 2 arguments
2023-01-10 13:02:36 +01:00
Gergő Jedlicska 3db8565f57 fix(type-validation): fix union types with more than 2 arguments 2023-01-10 12:58:19 +01:00
Alan Rynne a32822f4e3 ci: Updated github actions to use new actions repo 2023-01-09 20:42:24 +01:00
Gergő Jedlicska 40956927c8 Merge pull request #250 from specklesystems/gergo/nonGenericTFix
fix(typing): fix non generic typedefed lists and tuples
2023-01-09 15:54:36 +01:00
Gergő Jedlicska 4628f111ba fix(type-checking): fix py >= 3.9 dict type checking 2023-01-09 15:53:15 +01:00
Gergő Jedlicska 9c952b432d fix(typing): fix non specificed generic types for py 3.7 py 3.8 2023-01-09 15:39:45 +01:00
Gergő Jedlicska f075988e4b fix(typing): fix non generic typedefed lists and tuples 2023-01-09 15:10:23 +01:00
Gergő Jedlicska 65c829404a Merge pull request #247 from specklesystems/gergo/pathingUnification
feat(path-handling): rework path handling to match behavior of Core
2023-01-06 15:20:28 +01:00
Jedd Morgan 85e7a72524 fix(tests): Fixed regex escape on path tests 2023-01-06 14:00:19 +00:00
Gergő Jedlicska 0533aa0139 Merge pull request #248 from specklesystems/gergo/updatePypiAuth
;51R;51R
2023-01-05 16:18:22 +01:00
Gergő Jedlicska 04b733a241 ci(circleci): update pypi context usage 2023-01-05 16:15:49 +01:00
Gergő Jedlicska 01036c0f2e test(unit-tests): fix unit tests after merge 2023-01-05 11:06:11 +01:00
Gergő Jedlicska 4d8ca534fe Merge branch 'main' of github.com:specklesystems/specklepy into gergo/pathingUnification 2023-01-05 11:05:03 +01:00
Gergő Jedlicska e941efd95c refactor(tests): split into unit and integration tests folder 2023-01-05 10:59:43 +01:00
Gergő Jedlicska be9defbfa9 Merge pull request #245 from specklesystems/gergo/fully_qualified_names
feat(Base): rework speckle_type handling to better align with Core
2023-01-05 10:55:32 +01:00
Gergő Jedlicska dd54c69554 feat(path-handling): rework path handling to match behavior of Core 2023-01-05 10:41:39 +01:00
Gergő Jedlicska 93c1ec9556 Merge pull request #240 from ItsPatrickHe/bugfix/results_default_values
Update default value of results from 0.0 to None to align with the default value in speckle-sharp
2023-01-04 10:31:18 +01:00
Gergő Jedlicska 659c57e840 Merge branch 'main' of github.com:specklesystems/specklepy into pr/ItsPatrickHe/240 2023-01-04 10:27:38 +01:00
Gergő Jedlicska 1cdd4ffc9c feat(Base): rework speckle_type handling to better align with Core
use a dotnet `FullName` like behavior to deremine the speckle_type

fixes #231
2023-01-04 10:15:36 +01:00
Gergő Jedlicska 5ae022d2ed Merge pull request #244 from specklesystems/gergo/fixNoneInListSerialization
fix(BaseObjectSerializer): fix converting None in list to the string "None"
2022-12-21 16:04:33 +01:00
Gergő Jedlicska 31ca59cea8 fix(BaseObjectSerializer): fix converting None in list to the string "None" 2022-12-21 16:00:49 +01:00
Jinxuan He c91f673dba Add optional for float, regarding type checking 2022-12-21 12:38:21 +01:00
Gergő Jedlicska e2c8ef1b3d Merge pull request #239 from mortenengen/update-pydantic-dep
fix: update minimum required version of pydantic
2022-12-21 12:05:44 +01:00
Gergő Jedlicska b6b0a5a3a0 Merge pull request #242 from specklesystems/gergo/pre-commit
gergo/pre commit
2022-12-21 12:00:45 +01:00
Gergő Jedlicska f36d63a2cf Merge pull request #241 from specklesystems/speckle_type_sync_with_core
speckle type sync with core
2022-12-21 11:59:39 +01:00
Gergő Jedlicska afb9065fb9 fix(metrics): fix missing default arg to track function 2022-12-20 14:53:59 +01:00
Gergő Jedlicska fcc33f8989 style(all-project): fix all linting errors across the project with the current setup 2022-12-20 14:46:36 +01:00
Gergő Jedlicska 2cf9b64221 style(server-transport): fix import export 2022-12-20 10:47:48 +01:00
Gergő Jedlicska 990cf4eb2f style(whole-project): fixing linting and typing errors 2022-12-20 10:45:22 +01:00
Gergő Jedlicska b25f2ab4bc style(whole-project): fix styling from new pre-commit config 2022-12-19 14:03:20 +01:00
Gergő Jedlicska a8786c126d build(pre-commit-config.yaml): add basic pre-commit config 2022-12-19 14:02:42 +01:00
Gergő Jedlicska a35f8936ca bump: version 2.9.1 → 2.9.2 2022-12-19 12:44:11 +01:00
Gergő Jedlicska d965cc0988 add pre-commit dependency 2022-12-19 12:37:20 +01:00
Gergő Jedlicska 59a6950eed fix type checking error message 2022-12-16 22:01:56 +01:00
Gergő Jedlicska 6804282fac import ordering 2022-12-16 21:45:47 +01:00
Gergő Jedlicska a3a22a43d5 formatting fixes 2022-12-16 21:45:24 +01:00
Gergő Jedlicska 08aaa41b6c fix units 2022-12-16 21:45:04 +01:00
Gergő Jedlicska 07a3213ee9 fix objects import 2022-12-16 21:21:13 +01:00
Gergő Jedlicska 7a46176803 additional test cases for type validation 2022-12-16 21:17:39 +01:00
Jinxuan He b75501addd Update default value from 0.0 to None to align them with the default value in speckle-sharp 2022-12-16 15:42:59 +01:00
Gergő Jedlicska 15636dbe62 rework type checking in base 2022-12-16 13:41:07 +01:00
Gergő Jedlicska 9a2061d900 add missing object definitions from core 2022-12-16 13:40:43 +01:00
Morten Engen 8dc51fb936 Update min required version of pydantic 2022-12-16 12:30:56 +01:00
Gergő Jedlicska e805b8ac6e style(all): sort imports with isort 2022-12-09 20:48:02 +01:00
Gergő Jedlicska 5a1d624979 refactor(objects): fix import structure and typing errors for objects 2022-12-09 20:47:16 +01:00
Gergő Jedlicska c8808b07b3 fix(objects): update structural objects to better match core 2022-12-09 19:46:48 +01:00
Gergő Jedlicska 1a9b847c44 test(base): update base tests to properly test the speckle_type generation 2022-12-09 19:46:09 +01:00
Gergő Jedlicska f01fcb8e66 fix(base): update speckle_type creation to better match Core 2022-12-09 19:45:20 +01:00
Gergő Jedlicska 67499ab20c Merge pull request #219 from specklesystems/gergo/typeFixes
typing and formatting fixes
2022-12-09 12:36:07 +01:00
Gergő Jedlicska ebb703e68d Merge branch 'main' of github.com:specklesystems/specklepy into gergo/typeFixes 2022-12-08 14:27:42 +01:00
Gergő Jedlicska ef5d41da5d Merge pull request #233 from ItsPatrickHe/bugfix/property_attr_fix
Align the attribute names for Property1D, Property2D and Property3D w…
2022-12-08 14:26:36 +01:00
Gergő Jedlicska 851dd9c482 Merge pull request #234 from specklesystems/gergo/ciFix
ci(circleci): force integration test server to use localhost ipv4 adresses
2022-12-08 14:01:07 +01:00
Gergő Jedlicska 78074cf691 ci(circleci): force integration test server to use localhost ipv4 adresses 2022-12-08 13:03:39 +01:00
Jinxuan He be0daa419d Align the attribute names for Property1D, Property2D and Property3D with the speckle-sharp repo 2022-12-05 14:32:59 +01:00
Gergő Jedlicska a7d1b9ce30 Merge pull request #230 from specklesystems/gergo/py311
testing cimg/python311
2022-11-02 12:43:49 +01:00
Gergő Jedlicska 05756a8e9e testing cimg/python311 2022-11-02 12:41:32 +01:00
Gergő Jedlicska b50e658333 Merge pull request #228 from specklesystems/gergo/noDiskAccess
make sure specklepy send works completely without disk write access
2022-11-01 20:50:14 +01:00
Gergő Jedlicska 88248353ab make sure specklepy send works completely without disk write access 2022-11-01 16:43:17 +01:00
Alan Rynne aec94f8f7f Merge pull request #225 from specklesystems/gergo/limited_user_query
deprecate user resoure, add new active_user and other_user resources
2022-10-28 10:06:12 +02:00
Gergő Jedlicska e6b1604bc3 fix seed user redirects 2022-10-26 16:45:24 +02:00
Gergő Jedlicska de29b93b8b fix test ordering 2022-10-26 14:49:12 +02:00
Gergő Jedlicska 10aa8b59b6 update lock file 2022-10-26 14:43:22 +02:00
Gergő Jedlicska b86faa6a14 remove pytest sugar, its broken on circleci 2022-10-26 14:34:23 +02:00
Gergő Jedlicska 7430611c52 remove old dev dependency syntax 2022-10-26 14:31:04 +02:00
Gergő Jedlicska ddd52f4af9 deprecate user resoure, add new active_user and other_user resources 2022-10-26 11:30:04 +02:00
Gergő Jedlicska 35bc6b0350 Merge pull request #223 from specklesystems/gergo/src_folder
move code to /src/ folder pattern
2022-10-25 13:11:29 +03:00
Gergő Jedlicska 9585d46c4e move code to /src/ folder pattern 2022-10-25 11:55:27 +02:00
Gergő Jedlicska 1900fece8b version bump 2022-10-07 16:02:16 +02:00
Gergő Jedlicska 344b7de557 typing and formatting fixes 2022-10-07 15:59:48 +02:00
Alan Rynne fd09e97a53 Merge pull request #218 from specklesystems/gergo/receiveMetricsUpdate
gergo/receiveMetricsUpdate
2022-10-06 17:24:32 +02:00
Gergő Jedlicska 459bd0901f add untracked receive operations for connector side tracking 2022-10-06 16:40:03 +02:00
Gergő Jedlicska ae7c4bc14d add host aplication implementation from sharp 2022-10-06 16:39:40 +02:00
Gergő Jedlicska 41f1823aae Merge pull request #215 from specklesystems/gergo/urlCompare
gergo/urlCompare
2022-09-27 15:19:09 +02:00
Gergő Jedlicska 625bd5cd84 fixing path.unlink for py37 2022-09-27 15:13:29 +02:00
Gergő Jedlicska 8812985c67 Merge branch 'main' of github.com:specklesystems/specklepy into gergo/urlCompare 2022-09-27 14:57:48 +02:00
Gergő Jedlicska c838835a65 Merge pull request #213 from specklesystems/gergo/noneUnits
gergo/noneUnits
2022-09-27 14:56:54 +02:00
Gergő Jedlicska 361ba6bfcd fix stream wrapper matching on accounts with subdomain url-s 2022-09-26 20:15:45 +02:00
Gergő Jedlicska 8078a4b596 remove literal import 2022-09-26 09:59:42 +02:00
Gergő Jedlicska 08b106464f remove unused literal 2022-09-24 16:24:48 +02:00
Gergő Jedlicska 0cfe5db674 reformat stuff, fix backwards compatible typing 2022-09-24 16:22:04 +02:00
Gergő Jedlicska d9dbca2c68 py311 is not yet supported by circleci base images 2022-09-24 16:14:43 +02:00
Gergő Jedlicska ab5b55871b test for python311 2022-09-24 16:12:01 +02:00
Gergő Jedlicska 2f87956154 remove checking for the fetched users email 2022-09-24 16:09:47 +02:00
Gergő Jedlicska 6fc4ab1539 update tests 2022-09-23 17:09:25 +02:00
Gergő Jedlicska 7f432e768d Fix warnings about None type units being set on Base objects
Add proper units enum implementation

Co-authored-by: Alan Rynne <alan@speckle.systems>
Co-authored-by: Morten Engen <morten.engen@multiconsult.no>
2022-09-23 17:08:53 +02:00
izzy lyseggen d0eb364b3e feat(client): add monitoring headers to client setup (#209)
* chore: delete unused file

* feat(client): update monitoring headers in setup
2022-09-08 10:08:34 +01:00
Reynold Chan 936b2d8b5a Update material.py 2022-08-22 23:16:19 -04:00
luzpaz 5a9aec80bd Fix: misc. typos (#208)
Just some minor typos
2022-08-22 12:24:11 +01:00
izzy lyseggen 6616526279 fix(metrics): log ex as debug for jupyter notebook (#206)
* 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
2022-08-16 10:44:14 +01:00
izzy lyseggen 6e00de58b9 Revert "fix(metrics): log ex as debug for jupyter notebook (#204)" (#205)
This reverts commit 506aaf68ca.
2022-08-16 10:41:03 +01:00
Iain Sproat 0ec404bbec GitHub template update (#203)
* 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>
2022-08-16 10:37:21 +01:00
izzy lyseggen 506aaf68ca fix(metrics): log ex as debug for jupyter notebook (#204)
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!
2022-08-16 10:35:57 +01:00
izzy lyseggen 9fa6b661eb feat(client): stream invites (#202)
* 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
2022-07-26 17:58:46 +01:00
izzy lyseggen d1adccba00 feat(serialization): cache bases on deserialize (#200)
* 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
2022-07-20 18:02:25 +01:00
Reynold Chan 9e30250446 Create test_structural.py (#180) 2022-07-15 16:38:55 +01:00
Morten Engen 3e7d657e2e feat(base): sort serializable attributes (#198)
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.
2022-07-11 12:19:22 +01:00
izzy lyseggen 7484d8441b fix(credentials): clean up sqlite transport directly after getting accts (#199)
* fix(sqlite): use `self.close()` on del

* fix(credentials): close sqlite directly after use

* refactor(serializer): consolidate var name for ids
2022-07-11 10:31:19 +01:00
izzy lyseggen 682afce05f fix(transport): call begin/end write in server (#195)
* fix(transport): call begin/end write in server

* style: remove unused code
2022-06-30 16:16:05 +01:00
izzy lyseggen 21b27e2f3b feat(metrics): add ids for unknown users (#194)
* 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
2022-06-28 12:23:19 +01:00
izzy lyseggen 69cd9706cf fix(base): remove default units to Base (#193)
* fix(base): remove default units to `Base`

change in sharp that wasn't propagated to py!

* fix(objects): add `None` to unit encodings
2022-06-22 17:03:50 +01:00
izzy lyseggen 98075fa2cf fix(metrics): remove unused prop (#192) 2022-06-22 14:52:49 +01:00
izzy lyseggen 782f70fb49 chore: drop python 3.6 and update ujson (#190)
* 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
2022-06-20 12:19:09 +01:00
Gergő Jedlicska 52ab27e60f SQLite write batching (#188)
### 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>
2022-06-20 12:00:09 +01:00
izzy lyseggen 61e7ebeabd fix(client): add faves count to mutation return (#186) 2022-04-25 11:45:54 +01:00
izzy lyseggen 3a8121c306 feat(client): stream model update + favoriting (#185)
* 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
2022-04-25 11:32:24 +01:00
izzy lyseggen 209a95879f fix(metrics): patch app version check 2022-04-22 11:46:27 +01:00
izzy lyseggen 4f829d9908 feat(metrics): some cleanup and updates (#184)
- 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)
2022-04-22 11:26:28 +01:00
luzpaz ac5345f528 Fix various typos (#181) 2022-04-21 17:56:11 +01:00
izzy lyseggen 1142481d89 fix(geometry): int(index vals) for curve encoding (#183)
* 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)
2022-04-21 17:50:43 +01:00
izzy lyseggen b4690f082f feat(objects): revit params in objects for blender (#179) 2022-04-01 11:58:49 +01:00
izzy lyseggen 81a98ea938 feat(client): stream and user activity (#176)
* 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
2022-03-23 17:34:10 +00:00
izzy lyseggen 9b387da77a feat(serialisation): enums (#175)
note that this won't re-serialise dynamic members as enums.
they will come back as ints for consistency w sharp

closes 🃏 Enum serialisation bug #174
2022-03-23 11:49:16 +00:00
izzy lyseggen d0724c7d06 fix(objects): brep display val fix (#170)
* fix(client): auth fix

* fix(objects): temp displayValue prop setter

will be removed in the future, but keeping it now for backwards compat
2022-03-02 14:17:04 +00:00
izzy lyseggen 1414a3611b fix(wrapper): use full url for creating shell account (#169)
used for creating a transport if you don't have a local account
for the specified server
2022-03-01 10:33:47 +00:00
izzy lyseggen a553c17c43 fix/test(serialization): null values in dicts (#168) 2022-02-24 11:31:04 +00:00
izzy lyseggen 0be3fac6ab docs: update streamwrapper docstring 2022-02-23 16:52:23 +00:00
izzy lyseggen 944e70221e refactor(auth&metrics): use accounts everywhere and switch metrics (#166)
* feat(metrics): wip

* refactor(auth): use accts instead of tokens

* fix(wrapper): delayed auth bug

* refactor(memory): quick fix

* fix(creds): change incompatible py 3.8+ syntax

* feat(anatylics): updates tracking

* fix(credentials): catch when no accts

* fix(metrics): remove unused field

* feat(wrapper): raise exception for old import

* feat(analytics): consolidate names
2022-02-23 11:00:04 +00:00
izzy lyseggen 21f13c4750 chore: lgtm fixes (#164)
* chore: clean imports

* chore: more lil fixes
2022-02-21 11:19:06 +00:00
izzy lyseggen be85ddd159 feat(server): force utf-8 encoding (#163)
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
2022-02-18 10:33:25 +00:00
izzy lyseggen 77c538ced9 feat(server): allow unauth server transport (#162)
for receiving public objects
2022-02-17 10:10:25 +00:00
izzy lyseggen ee55680b03 feat(objects): add and test Mesh.create() (#161) 2022-02-08 16:56:33 +00:00
Reynold Chan 0728239915 Merge pull request #141 from specklesystems/structural/objects
Python Structural Objects Classes
2022-01-31 08:49:29 -05:00
izzy lyseggen 77016e6f0b chore(dev): update py and fix EOL errors (#157)
* chore(dev): fix eol probs on win

* chore(dev): bump py to 3.9
2022-01-24 15:17:23 +00:00
Antoine Dao ce39aa5101 chore(dev): add devcontainer configuration (#121)
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
2022-01-24 10:55:39 +00:00
izzy lyseggen f32196ce1b feat(client/ops): handle invalid token errors (#156)
* feat(client): validate token in `authenticate`

* feat(server transport): catch invalid token

* test(client/ops): error handling of invalid tokens

* feat(client): warning rather than exception
2022-01-21 16:32:33 +00:00
izzylys 6b24e187a5 fix(wrapper): quick acct field fix 2022-01-12 11:33:01 -08:00
izzy lyseggen 129d25df0e Merge pull request #154 from specklesystems/izzy/ujson-fix
fix(serializer): ujson big int issue
2022-01-10 19:34:14 +00:00
izzy lyseggen fa31bd0223 Merge pull request #153 from specklesystems/izzy/streamwrapper-alignment
feat(wrapper): make acct/client private
2022-01-10 19:33:33 +00:00
izzylys 21209b384d feat(wrapper): make acct/client private
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"
2022-01-10 11:30:39 -08:00
izzylys 1a9c95871f test(serializer): big int fix 2022-01-10 11:19:11 -08:00
izzylys dc4d583121 fix(serializer): fall back to json lib for big int 2022-01-10 11:19:05 -08:00
izzy lyseggen ed39f0288f Merge pull request #151 from specklesystems/cristi/surface_client_error
surface server validation errors
2022-01-03 16:11:29 +00:00
cristi8 3830706eb1 surface server validation errors 2022-01-02 11:18:56 +02:00
izzy lyseggen f7ae62ade2 Merge pull request #149 from specklesystems/izzy/null-units-hotfix
fix(units): warn and don't set for invalid args
2021-12-22 09:07:40 +00:00
izzy lyseggen 38ffbc27b7 test(units): goddamnit codecov 2021-12-22 09:06:28 +00:00
izzy lyseggen 8cebccf250 fix(units): warn and don't set for invalid args 2021-12-22 09:00:39 +00:00
izzy lyseggen 17aac0b552 Merge pull request #148 from specklesystems/izzy/allow-nulls
feat(serialisation): allow null values
2021-12-16 16:59:51 +00:00
izzy lyseggen c281a329a4 fix(serialisation): nulls & things ^^ 2021-12-16 16:57:36 +00:00
izzy lyseggen ca472716db feat(serialisation): allow null values 2021-12-16 16:41:09 +00:00
izzy lyseggen af50afe3ff Merge pull request #144 from specklesystems/izzy/transforms-rework
feat(objects): transforms and blocks!
2021-12-13 12:03:50 +00:00
izzy lyseggen b6493df77f test(transform): serialisation and vector transform tests 2021-12-13 11:48:05 +00:00
izzy lyseggen 59d3c8c3ea feat(objects): transform vectors & ignore fields 2021-12-13 11:47:49 +00:00
izzy lyseggen 4e3405f1fb fix(base): props with no setter 2021-12-13 11:47:10 +00:00
Reynold Chan 3772c10b31 Create results.py 2021-12-12 13:30:50 -05:00
Reynold Chan 242be2fa60 fixed per izzy's suggestion for naming convention + circular dependency 2021-12-10 18:08:41 -05:00
izzy lyseggen 49eabdd712 test(objects): transform create w malformed input 2021-12-10 18:34:40 +00:00
izzy lyseggen 96a31f0678 test(objects): transform methods 2021-12-10 18:29:35 +00:00
izzy lyseggen 91506b0b20 feat(objects): transforms and blocks! 2021-12-10 17:52:25 +00:00
izzy lyseggen b0de9e31b5 Merge pull request #143 from specklesystems/izzy/commits-hotfix
fix(client): add `branchName` to commits query
2021-12-10 11:50:24 +00:00
izzy lyseggen 2075783134 feat(models): add branchName to commit repr 2021-12-10 11:44:07 +00:00
izzy lyseggen 071f2449c3 fix(client): oopsie missing field in commit.list
thanks @mortenengen for the spot!
closes #142
2021-12-10 11:40:03 +00:00
izzy lyseggen ffa4f29200 fix(structural): correct import path for Axis 2021-12-10 11:18:24 +00:00
izzy lyseggen 40a691b098 style(structural): formatting pass
@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
2021-12-10 11:16:38 +00:00
Reynold Chan 487ce3aeb4 structural enums for geometry 2021-12-09 08:25:34 -05:00
Reynold Chan 6c0f10ae45 loading + analysis structural python + enums 2021-12-09 03:43:18 -05:00
Reynold Chan 436b26c91c structural geometries python classes 2021-12-08 08:47:22 -05:00
Reynold Chan f7bac26aed finished structural properties 2021-12-07 21:37:55 -05:00
Reynold Chan a31c049b51 materials done 2021-12-06 14:02:52 -05:00
izzy lyseggen a419664461 Merge pull request #140 from specklesystems/izzy/bump-deps
chore: update deps
2021-11-30 11:52:09 +00:00
izzy lyseggen 4a0c07009b chore: update deps 2021-11-30 11:50:34 +00:00
Gergő Jedlicska 682bcbfa9f Merge pull request #138 from specklesystems/gergo/ci_test_report
add codecov badge
2021-11-24 18:56:11 +01:00
Gergő Jedlicska ccf284e8fa add codecov badge 2021-11-24 18:53:44 +01:00
Gergő Jedlicska 23102a28ff Merge pull request #137 from specklesystems/gergo/ci_test_report
add circle_ci reporting
2021-11-24 18:46:25 +01:00
Gergő Jedlicska 5475edb253 coverage report to xml 2021-11-24 18:28:36 +01:00
Gergő Jedlicska c52f80c1ef add codecov upload 2021-11-24 18:21:39 +01:00
Gergő Jedlicska 21eecfa24c add circle_ci reporting 2021-11-24 16:47:48 +01:00
izzy lyseggen 5dde1bfcf1 Merge pull request #136 from specklesystems/izzy/stream-wrapper-fix
fix(wrapper): fix for nested branches
2021-11-17 16:12:42 +00:00
izzy lyseggen 82c9d874c9 test(branches): server now returns main first 2021-11-17 16:11:22 +00:00
izzy lyseggen 9acf2c8a92 fix(wrapper): fix for nested branches 2021-11-17 15:59:51 +00:00
Gergő Jedlicska 95012e60c1 Merge pull request #132 from specklesystems/commit-recieved
Commit recieved
2021-10-29 11:01:21 +02:00
Gergő Jedlicska 19b6500bbd Merge branch 'main' of github.com:specklesystems/specklepy into commit-recieved 2021-10-29 10:53:28 +02:00
Gergő Jedlicska 47a06e4630 version bump 2021-10-29 10:49:36 +02:00
Alan Rynne e5a8b40bb2 Merge pull request #131 from specklesystems/commit-recieved
commit recieved service implementation
2021-10-29 10:48:55 +02:00
Gergő Jedlicska 219456f5f8 circleci py310 is not working 2021-10-27 20:28:01 +02:00
Gergő Jedlicska d1544ae89f Merge branch 'commit-recieved' of github.com:specklesystems/specklepy into commit-recieved 2021-10-27 19:20:15 +02:00
Gergő Jedlicska 8f7d4b2ca7 add 3.10 as target 2021-10-27 19:20:04 +02:00
Gergő Jedlicska a7d31d4983 Delete stream_copy.py 2021-10-27 19:18:45 +02:00
Gergő Jedlicska a89b12a02c remove receive server test 2021-10-27 19:16:08 +02:00
Gergő Jedlicska 15ae68f5d7 commit received implementation 2021-10-27 14:13:49 +02:00
izzy lyseggen 0709cd99b5 Merge pull request #129 from specklesystems/izzy/token-auth
feat(wrapper/transport): token auth
2021-10-22 11:21:23 +02:00
izzy lyseggen faf06f7141 fix(server): set transport url 2021-10-21 13:12:19 +01:00
izzy lyseggen b54e09f811 test: server transport & wrapper token auth 2021-10-21 12:20:09 +01:00
izzy lyseggen 55b7e0d732 feat(wrapper): token auth for client and transport 2021-10-21 12:19:49 +01:00
izzy lyseggen 45c922679b feat(server): allow construction with token & url 2021-10-21 12:19:19 +01:00
izzy lyseggen b1c149382a Merge pull request #128 from specklesystems/izzy/cereal-fixes
fix(deserialisation): type check bug and brep encoding hotfix
2021-10-14 17:09:27 +02:00
izzy lyseggen 393e98c8c2 fix(encoding): add none unit type 2021-10-14 16:07:34 +01:00
izzy lyseggen 8376329cbb fix(base): type check error with optional generics
reported by rob on the forum:
https://speckle.community/t/issue-with-type-checking-in-pyhton/1861
2021-10-14 15:41:30 +01:00
izzy lyseggen 1567fe9e68 fix(breps): temp hotfix for curve encoding fail
addresses 🥒 Bug with brep receiving (curve encoding) #127
2021-10-14 15:38:51 +01:00
izzy lyseggen 364b826a1b Merge pull request #126 from specklesystems/izzy/metrics-hotfix
fix(metrics): typo in tracking send
2021-10-13 11:28:52 +02:00
izzy lyseggen 297dbab479 fix(metrics): typo in tracking send
i'm a dumdum
2021-10-13 10:27:58 +01:00
izzy lyseggen 81680ed766 Merge pull request #125 from specklesystems/izzy/metrics
metrics 🛰
2021-10-12 11:38:40 +02:00
izzy lyseggen c934720bb0 fix(metrics): try catch whole track method 2021-10-12 10:36:38 +01:00
izzy lyseggen 9297a5df49 feat(metrics): disable in tests 2021-10-11 18:10:53 +01:00
izzy lyseggen 7b8bf49769 feat(metrics): track creds, ops, and stream events 2021-10-11 18:10:33 +01:00
izzy lyseggen c834496b72 feat(metrics): add them! 🛰 2021-10-11 18:09:50 +01:00
izzy lyseggen f49491611f Merge pull request #124 from specklesystems/izzy/objects
fix(objects): quick geo and style edits
2021-10-04 09:39:55 +01:00
izzy lyseggen 19b83ba191 fix(objects): quick geo and style edits 2021-10-04 09:37:42 +01:00
izzy lyseggen 8d81aab1ac Merge pull request #123 from specklesystems/izzy/server-errors
fix(batch sender): improve error messages
2021-10-04 08:53:40 +01:00
izzy lyseggen 16868fbf3b fix(batch sender): improve error messages
for when send fails completely. previously user only got a
json decode error
2021-10-04 08:53:02 +01:00
Matteo Cominetti 00892fc838 Create close-issue.yml 2021-10-02 17:13:24 +01:00
Matteo Cominetti 4987b33de2 Create open-issue.yml 2021-10-02 17:13:09 +01:00
izzy lyseggen 766f1fa840 Merge pull request #120 from AntoineDao/geometry-chunks-serialization
Geometry chunks serialization
2021-09-30 11:59:28 +01:00
AntoineDao 69a5248abb fix(brep): fix Curve2DValues.setter 2021-09-19 10:08:57 +00:00
AntoineDao 5c93e4f9dc test(geometry): rewrite tests so they can fail
I noticed that the Curv2D setter had a bug which wasn't caught by tests so I rewrote them to fail first
2021-09-19 10:08:28 +00:00
AntoineDao e20b9b73c9 fix(brep): update vertices and trim values serialization
It turns out that those are not serialized like the other list attributes... Which is not super helpful or consistent but oh well :D
2021-09-18 22:54:58 +00:00
AntoineDao c06b20a963 style(comments): remove commented out code... 2021-09-18 21:56:59 +00:00
AntoineDao 5bc6b8c4ed style(brep): use getter/setter on XValues attributes 2021-09-18 21:54:58 +00:00
AntoineDao 3005e421a6 refactor(base): use get_serializable_attributes 2021-09-18 11:47:47 +00:00
AntoineDao 8fb03972d5 fix(serialization): fix some bugs I introduced by not testing before committing... 2021-09-18 11:29:00 +00:00
AntoineDao 02702190c9 fix(object): move array encoding from datachunk to its own class 2021-09-15 23:30:59 +01:00
AntoineDao 2bd31ae954 style(lint): clean up code and update/re-order imports 2021-09-15 23:00:41 +01:00
AntoineDao d0f8f95e4e feat(brep): use list serializers 2021-09-12 17:43:12 +00:00
AntoineDao fc3ae3b98e feat(base): add 'ignore_serialize' attribute
This enables users to specify attributes which should not be included in object serialization but should still be public members
2021-09-12 17:42:00 +00:00
AntoineDao a6b19025e6 feat(base): add data chunk encoding/decoding methods
These are helpful to iterate over chunked lists of encoded geometry objects and decode them into base objects (and vice versa)
2021-09-12 17:38:56 +00:00
AntoineDao 2be82f0874 feat(geometry): add list encoding serialization
Most geometry objects can be encoded and decoded from list of floats that look like protobuffs in C#. This commit simply reproduces those methods
2021-09-12 17:36:40 +00:00
izzy lyseggen 70191b97a2 docs: update readme to align with new format 2021-09-03 16:20:15 +01:00
izzy lyseggen dd2825272d docs: update readme to align with new format 2021-09-03 16:18:18 +01:00
izzy lyseggen 9303af6827 Merge pull request #118 from specklesystems/izzy/simpler-typing
feat(base): remove pydantic and roll our own type checking
2021-09-02 12:46:18 +01:00
izzy lyseggen 973dc07d5b fix(base): little tweaks 2021-08-24 15:50:08 +01:00
izzy lyseggen 7dd5b7a2a1 test(base): type checks 2021-08-24 12:11:46 +01:00
izzy lyseggen f259f256c7 feat(base): smol get_member fixes and others 2021-08-24 11:50:23 +01:00
izzy lyseggen 08986056a3 test(obj): quick fix 2021-08-20 13:29:21 +01:00
izzy lyseggen f89b07eacb feat(🥣): custom base types and test fixes 2021-08-20 13:09:09 +01:00
izzy lyseggen c973d916b3 fix(base): py 3.6 typing fix 2021-08-20 12:10:52 +01:00
izzy lyseggen 4ff6288317 feat(🥣): faster get_member_names 2021-08-20 11:56:04 +01:00
izzy lyseggen 8566674f2e Merge pull request #119 from specklesystems/izzy/cred-fix
fix(credentials): fix in get client
2021-08-19 18:28:09 +01:00
izzy lyseggen 1f3b6da9c7 fix(credentials): fix in get client
oopsie think this was a merge error
2021-08-19 18:26:44 +01:00
izzy lyseggen 5d99d5fcad feat(serialisation): swap out json for ujson 2021-08-19 18:25:12 +01:00
izzy lyseggen 4fc07f33d0 fix(base): try fix for 3.7 and 3.6 2021-08-19 17:52:22 +01:00
izzy lyseggen 4e23a69b89 fix(base): chunk fixes 2021-08-19 17:44:50 +01:00
izzy lyseggen 04a0ddc8c4 fix(api): obj receive change w new base 2021-08-19 17:33:41 +01:00
izzy lyseggen 1b4d43e0aa fix(base): add init w kwargs 2021-08-19 16:01:00 +01:00
izzy lyseggen f78c8c407f docs(base): docstring for of_type 2021-08-19 15:50:45 +01:00
izzy lyseggen 892c11f38f fix(base): remove unused init 2021-08-19 14:13:43 +01:00
izzy lyseggen 72639bf4bb fix(base): bypass for setting speckle_type on base 2021-08-19 13:58:25 +01:00
izzy lyseggen b2c210abc1 fix(serialiser): pop speckle_type from obj dict 2021-08-19 13:54:23 +01:00
izzy lyseggen 2250e8a897 fix(wrapper): bug in get_client 2021-08-19 13:53:58 +01:00
izzy lyseggen cb07f55551 feat(base): remove pydantic and diy the type check
- 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
2021-08-19 12:25:03 +01:00
izzy lyseggen d1b3d5e25e Merge pull request #117 from specklesystems/izzy/tiny-fix
fix(objects): init polyline value w empty list
2021-08-12 11:51:34 +01:00
izzy lyseggen 79cca557f5 fix(objects): init polyline value w empty list
soz!
2021-08-12 11:49:41 +01:00
izzy lyseggen 1e6e66a90a Merge pull request #116 from specklesystems/izzy/commit-spec
feat(client): add `branchName` to commit model
2021-08-11 09:24:49 +01:00
izzy lyseggen 09d84cf64a feat(client): add branchName to commit model 2021-08-11 09:21:04 +01:00
izzy lyseggen 3ccb0ae2a8 ci: try diff env tag variable 2021-08-10 15:49:08 +01:00
izzy lyseggen 6028a38355 Merge pull request #115 from specklesystems/ci/tags-and-versions
ci: fix workflows and patch version with git tag
2021-08-10 15:42:42 +01:00
izzy lyseggen 07418cfc9c ci: rename test job 2021-08-10 15:41:03 +01:00
izzy lyseggen 1ada797d81 ci: rename test job 2021-08-10 15:40:32 +01:00
izzy lyseggen 73703f6237 ci: patch version with git tag 2021-08-10 15:38:02 +01:00
izzy lyseggen 7644af22df fix(ci): add tag filter to build job 2021-08-10 15:37:19 +01:00
izzy lyseggen 564e1d4432 Merge pull request #114 from specklesystems/izzy/stream-wrapper-update
feat(wrapper): add get acct helper
2021-08-10 12:34:08 +01:00
izzy lyseggen fc4511ad02 chore: bump version 2021-08-10 12:03:06 +01:00
izzy lyseggen ad710b72da feat(wrapper): add acct helper 2021-08-10 12:02:42 +01:00
izzy lyseggen 041d9f56ce ci: another workflow fix 🙃 2021-08-06 17:13:16 +01:00
izzy lyseggen e1c0b705ad ci: build in deploy fix 2021-08-06 17:10:55 +01:00
izzy lyseggen 7b011b1122 ci: require build in deploy step 2021-08-06 17:06:42 +01:00
izzy lyseggen 3f09cd9d77 chore: bump version 2021-08-06 17:02:19 +01:00
izzy lyseggen 29a361892b Merge pull request #113 from specklesystems/izzy/stream-wrapper
🌯 Stream Wrapper with Client & Server Transport helper methods
2021-08-06 16:54:53 +01:00
izzy lyseggen 2672b40aff ci: remove speckle-server version 2021-08-06 16:53:09 +01:00
izzy lyseggen 35b6911b27 ci: quick fix 2021-08-06 16:43:53 +01:00
izzy lyseggen a4f0a2cc2b feat(server): transport init exception if no token 2021-08-06 16:39:02 +01:00
izzy lyseggen 1970890ecc test: stream wrapper tests 2021-08-06 16:38:40 +01:00
izzy lyseggen 13df5135b8 feat(credentials): stream wrapper!
can provide client and transport for you
2021-08-06 16:38:10 +01:00
izzy lyseggen 4e206b5c60 style: formatting 2021-08-06 16:09:12 +01:00
izzy lyseggen e696091555 feat(client): add string repr 2021-08-06 16:08:46 +01:00
izzy lyseggen a512dbb4e4 feat(logging): add SpeckleWarning class 2021-08-06 16:08:18 +01:00
izzy lyseggen 9a1f28516d chore: bump version to 2.2.5 2021-07-30 11:35:43 +01:00
izzy lyseggen 92892b83d8 Merge pull request #110 from specklesystems/izzy/sql-fix
fix(sqlite): delay and try except transport init
2021-07-30 11:31:55 +01:00
izzy lyseggen 8904e9eeb4 docs(ops): note that sqlite is default for receive 2021-07-30 11:31:18 +01:00
izzy lyseggen 68dc1794ee fix(sqlite): try catch initialisation of transport 2021-07-30 11:25:35 +01:00
izzy lyseggen 7e7940f25b refactor(ops): delay init of SQLiteTransport 2021-07-30 11:25:02 +01:00
izzy lyseggen 29c97cde45 chore: bump version to 2.2.4 2021-07-29 16:14:25 +01:00
izzy lyseggen 02f4f4fe41 Merge pull request #109 from specklesystems/izzy/sql-transport
feat(sqlite): remove unusued queue
2021-07-29 16:12:37 +01:00
izzy lyseggen b2dd5bfedd feat(sqlite): remove unusued queue 2021-07-29 16:11:04 +01:00
izzy lyseggen 09b3edcc23 Merge pull request #106 from specklesystems/izzy/smol-sparkles
fix(base): get parent props on child serialisation
2021-07-28 18:08:00 +01:00
izzy lyseggen a44036863d fix(base): get units prop on children 2021-07-28 18:01:51 +01:00
izzy lyseggen 5806c032dd feat(units): add km 2021-07-28 18:01:25 +01:00
izzy lyseggen cff20aec54 Merge pull request #105 from specklesystems/izzy/client-docstrings
docs(client): add dosctring to the `SpeckleClient`
2021-07-22 09:28:04 +01:00
izzy lyseggen 144d51b147 docs(client): add dosctring to the SpeckleClient
as alan noted, the default one is garbo lol
hopefully this will make it clearer for users
2021-07-22 09:27:32 +01:00
izzy lyseggen 09f61a6efd Update README.md 2021-07-22 09:15:26 +01:00
Matteo Cominetti e61bf0f78f Update README.md 2021-07-22 09:14:41 +01:00
izzy lyseggen 6ac72ce8ee Merge pull request #104 from specklesystems/izzy/readme
docs(readme): use xyz as example host
2021-07-22 09:12:34 +01:00
izzy lyseggen 0b9ef942f5 docs(readme): use xyz as example host 2021-07-22 09:12:20 +01:00
izzy lyseggen 6988eae46f Merge pull request #102 from specklesystems/izzy/deps-issues
chore(build): update to gql 3.0.0a6
2021-06-11 14:54:32 +01:00
izzy lyseggen 31fa619f82 chore(build): update to gql 3.0.0a6 2021-06-11 14:52:28 +01:00
izzy lyseggen 409ac68df0 Merge pull request #101 from specklesystems/izzy/json-acct-tweak
Izzy/json acct tweak
2021-06-04 17:37:25 +01:00
izzy lyseggen 81051a87c1 chore: bump version 2021-06-04 17:36:02 +01:00
izzy lyseggen fca386706b fix(credentials): tweak default base path
align with docs
2021-06-04 17:35:25 +01:00
izzy lyseggen 80036b0b98 Merge pull request #100 from specklesystems/izzy/json-accts
feat(credentials): read json files from local accts
2021-06-04 11:42:59 +01:00
izzy lyseggen 92c9a0882e chore: revert yml change 2021-06-04 10:30:20 +01:00
izzy lyseggen 239c466264 chore: bump version 2021-06-04 10:24:09 +01:00
izzy lyseggen 7dd490b24f feat(accounts): read json files from local 2021-06-04 10:23:54 +01:00
izzy lyseggen 54c3d6fbaf chore: bump version 2021-06-02 10:12:58 +01:00
izzy lyseggen 7b7cd86f50 Merge pull request #99 from specklesystems/izzy/note-on-paths
docs: data paths for diff platforms
2021-05-27 18:06:39 +01:00
izzy lyseggen 3fde452d1e docs: data paths for diff platforms 2021-05-27 18:05:26 +01:00
izzy lyseggen 113d1f1993 Merge pull request #93 from CyrilWaechter/main
Fix: path process error on Linux #96
2021-05-27 17:28:03 +01:00
izzy lyseggen d2bacb9ec2 Merge pull request #98 from specklesystems/izzy/accts-hotfix
fix(credentials): make some fields optional
2021-05-25 15:30:14 +01:00
izzy lyseggen d461e64b97 fix(credentials): make some fields optional
for simple manual account addition
2021-05-25 15:23:16 +01:00
CyrilWaechter dc923c3105 Fix: specklesystems/speckle-blender/issues/24 2021-05-24 17:55:34 +02:00
Dimitrie Stefanescu 46437e7af4 Update README.md 2021-05-23 16:28:14 +01:00
Cristian Balas 6ba632b14d Merge pull request #87 from specklesystems/cristi/diff_endpoints
switched to diff endpoints for download/upload
2021-05-18 18:42:19 +03:00
cristi8 c67eb0520e better error handling, fixed an issue 2021-05-17 22:04:43 +03:00
izzy lyseggen b7b171289c Merge pull request #90 from specklesystems/izzy/nones-on-receive
fix(serializer): handle receiving `None` vals
2021-05-17 16:02:46 +01:00
izzy lyseggen c4ac12d9de fix(serializer): handle receiving None vals 2021-05-17 15:48:46 +01:00
cristi8 6abeafdd9e Save root object after the children are saved to local transport 2021-05-17 13:37:31 +03:00
cristi8 a016ed9201 Changed parameter name 2021-05-11 19:55:24 +03:00
cristi8 9e0f71e5c0 switched to diff endpoints for download/upload
WARNING: not compatible with older/current released speckle servers
2021-05-11 15:53:45 +03:00
izzy lyseggen e02c4a76e8 Merge pull request #86 from specklesystems/izzy/ci
Automated releases to PyPI
2021-04-30 16:04:10 +01:00
izzy lyseggen 8e14cf1904 ci: remove dry run safeguard 2021-04-30 16:02:33 +01:00
izzy lyseggen 1c868b6b60 ci: trying automated publishes 2021-04-30 15:55:37 +01:00
izzy lyseggen 809dff5fb0 build: bump minor version
new materials!
2021-04-30 15:44:17 +01:00
izzy lyseggen e5074acff9 Merge pull request #85 from specklesystems/izzy/ci
ci: switch to poetry
2021-04-27 10:34:39 +01:00
izzy lyseggen 85d2065c29 chore: remove requirements.txt 2021-04-27 10:19:14 +01:00
izzy lyseggen bb48054fea ci: switch to poetry maybe? :) 2021-04-27 10:05:39 +01:00
izzy lyseggen 5a9b4137da Merge pull request #84 from specklesystems/izzy/tests-fix
Fix failing tests
2021-04-22 10:05:29 +01:00
izzy lyseggen 6c7dc1eed9 tests: upload objects to each test stream 2021-04-22 09:54:23 +01:00
Alan Rynne d47bf7d842 Merge pull request #82 from specklesystems/ci/docker-images
ci: Spin-up new server for each test run
2021-04-21 11:23:10 +02:00
Alan Rynne d07bab61e7 ci: Fixes with Izzy 2021-04-21 10:05:18 +02:00
Alan Rynne 3f7290ed12 ci: Reverting 2021-04-20 20:17:01 +02:00
Alan Rynne ed92678a31 ci: Random test with "http" 2021-04-20 20:08:14 +02:00
Alan Rynne 0428d2149f ci: Run those tests! 2021-04-20 20:03:18 +02:00
Alan Rynne da2d646f78 ci: Testing matrix versions 2021-04-20 20:00:06 +02:00
Alan Rynne a6543b122f ci: Checking build script only... 🤔 2021-04-20 19:56:34 +02:00
Alan Rynne 4e26ebfbe2 ci: First coin-flip on Spinning up a Docker server for each test 2021-04-20 19:47:44 +02:00
izzy lyseggen 4f79698987 Merge pull request #81 from specklesystems/izzy/materials
feat(objects): add RenderMaterial
2021-04-15 17:05:05 +01:00
izzy lyseggen 2c10134703 feat(objects): add RenderMaterial 2021-04-15 17:04:39 +01:00
izzy lyseggen 27346b6d38 Merge pull request #78 from specklesystems/izzy/rename-package
Rename package to `specklepy` to avoid conflicting with 1.0
2021-04-09 12:36:35 +01:00
izzy lyseggen 816f4373dd chore: update pyproject.toml 2021-04-09 12:25:51 +01:00
izzy lyseggen 434ada8bc1 feat: rename speckle to specklepy 2021-04-09 12:25:32 +01:00
izzy lyseggen 066bc44457 Merge pull request #77 from specklesystems/izzy/datachunk-fix
fix(base): specify full name for datachunk
2021-03-22 17:30:08 +00:00
izzy lyseggen 633267b025 Merge pull request #76 from specklesystems/izzy/test-fix
test: update host to use latest.speckle.dev
2021-03-22 17:28:24 +00:00
izzy lyseggen bd4ae7c5c5 fix(base): specify full name for datachunk
would bork in other connectors with name as just `DataChunk`
2021-03-22 17:28:00 +00:00
izzy lyseggen 501f9b8648 test: update host to use latest.speckle.dev 2021-03-22 15:03:22 +00:00
izzy lyseggen 7d2a03e19d Merge pull request #74 from specklesystems/cristi/server_transport_batching
ServerTransport: object batching and sending from multiple background threads
2021-03-22 14:57:09 +00:00
cristi8 c6c7d1731a ServerTransport: Added object batching and sending from multiple background threads 2021-03-22 14:24:14 +02:00
izzy lyseggen a839073968 Merge pull request #73 from specklesystems/izzy/ops
feat(operations): better (de)serialize functions
2021-03-19 20:04:06 +00:00
izzy lyseggen 883ec6e6ae feat(operations): better (de)serialize functions
allow providing transports to the serialize / deserialize functions
to see detaching and chunking
2021-03-19 15:18:06 +00:00
izzy lyseggen 87002257be Merge pull request #72 from specklesystems/izzy/detached-attrs
feat(base): improve adding chunkables/detachables
2021-03-19 10:26:54 +00:00
izzy lyseggen 1bc0cf04f3 fix(base): grammar (detached -> detachable) 2021-03-19 10:20:17 +00:00
izzy lyseggen d0e2350ab7 feat(base): improve adding chunkables/detachables
adds helper methods on `Base` that can be called in the constructors
to prevent ppl messing this up when defining their own objects
2021-03-19 10:14:42 +00:00
izzy lyseggen 255681a887 Merge pull request #70 from specklesystems/izzy/detached-lists
feat(serialisation): optimisations baBY
2021-03-18 18:47:28 +00:00
izzy lyseggen 614eefc393 fix(serialisation): EMBARASSING BUG
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
2021-03-18 18:45:24 +00:00
izzy lyseggen d5b506f298 fix(base): swap getattr_static for getattr
brought serialisation time for a big object
down from 12 seconds to 1.7 seconds!!

ty cristi
2021-03-18 17:05:18 +00:00
izzy lyseggen dcd28b5d79 feat(base): don't return set id on get_id
align with core in that `get_id` _always_ fully serializes to get hash
2021-03-18 16:35:28 +00:00
izzy lyseggen c739594ba8 fix(serializer): add children count on serialize
this was previously done _after_ hashing leading to different hashes
on two same objects due to this one field being different
2021-03-18 16:35:28 +00:00
izzy lyseggen 1d4867fb9b test: add detached list to FakeMesh 2021-03-18 16:35:28 +00:00
izzy lyseggen ec94a42ac6 Merge pull request #69 from specklesystems/izzy/detached-lists
fix(serializer): detached lists
2021-03-18 11:09:47 +00:00
izzy lyseggen 6e64770380 test(serializer): test detachment within lists 2021-03-17 17:38:05 +00:00
izzy lyseggen ef92127ed2 feat(serializer): support detachment within lists
this was a borkage on my part - oops!
2021-03-17 17:37:45 +00:00
izzy lyseggen fb8a40bf76 Merge pull request #67 from specklesystems/izzy/objects
fix(serialiser): import geometry objects
2021-03-01 11:17:22 +00:00
izzy lyseggen 81fab3ec6b fix(serialiser): import geometry objects
default to using our obj for deserialisation
2021-03-01 11:15:51 +00:00
izzy lyseggen 9a0c36c665 Merge pull request #66 from specklesystems/izzy/objects
🧊 Basic Geometry Objects
2021-02-26 18:03:41 +00:00
izzy lyseggen 995526c786 feat(objects): jk i gotchu with dem breps 😉 2021-02-26 18:01:14 +00:00
izzy lyseggen 5a66d912ae test: update to use new geo objects 2021-02-26 16:56:49 +00:00
izzy lyseggen 78abbb18c4 feat(objects): geometry yoooo
all geo except for breps
2021-02-26 16:56:10 +00:00
izzy lyseggen 26abdc952a fix(units): add new none type 2021-02-26 16:28:38 +00:00
izzy lyseggen 9a0207ba09 feat(obj): update point class
remove value attribute
2021-02-24 18:34:40 +00:00
izzy lyseggen 4369f8c5c8 Merge pull request #64 from specklesystems/izzy/props
🥠 feat(base): support serialisation of all properties
2021-02-24 17:15:18 +00:00
izzy lyseggen bc432c2f13 feat(objects): override point type 2021-02-24 17:02:47 +00:00
izzy lyseggen d1d3876902 feat(serializer): traverse properties as well 2021-02-24 17:02:11 +00:00
izzy lyseggen b1b144969b feat(base): include properties in member names 2021-02-24 17:01:32 +00:00
izzy lyseggen 4e3ee488be refactor(operations): small simplification 2021-02-24 16:59:12 +00:00
izzy lyseggen b2e2455b16 Merge pull request #61 from specklesystems/izzy/bug-fixes
🐛 Even more bug fixes!
2021-02-22 18:27:06 +00:00
izzy lyseggen ede286f4c0 fix(serialiser): generalise receiving chunk check 2021-02-22 18:23:30 +00:00
izzy lyseggen 56547a4573 fix(client): register branches methods 2021-02-22 18:23:30 +00:00
izzy lyseggen 13886b9caf Merge pull request #58 from gjedlicska/base_type_registration
Custom Base subclasses are automatically registered for deserialization
2021-02-22 18:22:08 +00:00
Gergő Jedlicska 5342cc4827 fix(recomposition): add dictionary recomposition option
If speckle type is not defined for an object, its recomposition results a python dictionary.
2021-02-22 19:17:09 +01:00
Gergő Jedlicska 6fe338628d test(deserialization): undefined behavior of deserialization
Add failing test to uncover a possible bug in deserialization
2021-02-22 17:04:46 +01:00
Gergő Jedlicska 48883466fb Merge branch 'main' of github.com:specklesystems/speckle-py into base_type_registration 2021-02-22 16:59:22 +01:00
izzy lyseggen 47917d99b0 Merge pull request #60 from specklesystems/izzy/receive-fix
🐛 fix(serialiser): smol bug fixes
2021-02-22 10:53:24 +00:00
izzy lyseggen 7703de0a37 test: unknown type deserialisation 2021-02-22 10:22:02 +00:00
izzy lyseggen 81b96cb6ac fix(serialiser): smol bug fixes
- don't overwrite `speckle_type` when receiving unknown object
- check for empty lists on deserialisation
- explicit none check for ignored vals on serialisation
(was unintentionally ignoring `0`s)
2021-02-22 10:17:09 +00:00
Matteo Cominetti 2334aefb09 docs: updates readme with link to docs 2021-02-19 18:38:51 +00:00
Gergő Jedlicska 800b0018a0 style: ran formatter on codebase 2021-02-17 23:52:14 +01:00
Gergő Jedlicska e6cf22e97a feat(base.py): provide easy subclass type registration for (de)serialization
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
2021-02-17 23:51:07 +01:00
izzy lyseggen f5abcec6d0 Merge pull request #53 from CyrilWaechter/patch-1
Add infos and fix to README.md
2021-02-16 15:31:39 +00:00
Cyril Waechter fcd54a0899 Add info to README.md
* Add some import to make origin of objects / module used explicit
* Fix #L118:
```python
In [46]: received_base = client.object.get(hash)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-46-8171539461b3> in <module>
----> 1 received_base = client.object.get(hash)

TypeError: get() missing 1 required positional argument: 'object_id'
```
2021-02-16 15:43:36 +01:00
Gergő Jedlicska adfba846ce Merge branch 'base_type_registration' of github.com:gjedlicska/speckle-py into base_type_registration 2021-02-13 14:48:10 +01:00
Gergő Jedlicska 4933ca4abf feat(base object): enforce unique speckle_type value
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.
2021-02-13 14:46:54 +01:00
Gergő Jedlicska 8ce595cb4a feat(base object): enforce unique speckle_type value
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
2021-02-13 14:45:14 +01:00
Gergő Jedlicska 1114b210f9 refactor(objects module def): remove redundant subclass discovery code
With the automated subclass registry, there is no need for the magic module lookup in objects
__init__
2021-02-13 14:06:32 +01:00
Gergő Jedlicska 00c1e378d5 feat(base model and deserialization): base model subclasses can now be automatically deserialized
Subclassing types of Base are stored in a class attribute that can be looked up via the
`speckle_type`.

fix #50
2021-02-13 10:19:12 +01:00
Gergő Jedlicska 1291b5799b Merge branch 'main' of github.com:specklesystems/speckle-py into base_type_registration 2021-02-13 09:51:32 +01:00
izzy lyseggen 75fb2da7c2 Merge pull request #57 from specklesystems/izzy/obj-fix
🧺 Trash the workarounds in ops and serialiser for `speckle_type` vs `speckleType`
2021-02-12 11:33:58 +00:00
izzy lyseggen d760fa47ec refactor(base): more cleanup 2021-02-12 11:32:38 +00:00
izzy lyseggen e61968d88c refactor(ops): remove this nonsense lol
related to specklesystems
/
speckle-server#78

fixed in specklesystems/speckle-server@aca61b8
2021-02-12 10:57:56 +00:00
izzy lyseggen 01e3e5aa47 refactor(serializer): remove speckleType check
related to specklesystems
/
speckle-server#78

fixed in specklesystems/speckle-server@aca61b8
2021-02-12 10:57:35 +00:00
Gergő Jedlicska 7f2c26eb6b refactor(test_base.py): refactor base object invalid prop tests
Utilizing a few pytest features to make invalid prop tests a bit sleeker
2021-02-11 22:04:20 +01:00
Gergő Jedlicska 5f35da3be9 style(black config): added explicit black config to pyproject.toml 2021-02-11 21:43:28 +01:00
Gergő Jedlicska 98c3b89d75 Merge branch 'main' of github.com:specklesystems/speckle-py into base_type_registration 2021-02-11 20:35:22 +01:00
Gergő Jedlicska 5796ff6cdb docs(example/base_registrar.py): add example implementation for SpeckleBase class register
re #50
2021-02-11 20:34:35 +01:00
izzy lyseggen df4706aa56 Merge pull request #56 from specklesystems/revert-54-delete_requirements
Revert "Repo housekeeping"
2021-02-11 09:15:56 +00:00
izzy lyseggen 855d499eb8 Revert "Repo housekeeping" 2021-02-11 09:13:54 +00:00
izzy lyseggen a19ce15168 Merge pull request #55 from gjedlicska/base_validation_cleanup
Base object code cleanup
2021-02-11 09:09:50 +00:00
izzy lyseggen b2d89cad21 Merge pull request #54 from gjedlicska/delete_requirements
Repo housekeeping
2021-02-11 08:45:58 +00:00
Gergő Jedlicska f6c28689ce refactor(base.py): simplify some base object methods 2021-02-11 09:35:13 +01:00
Gergő Jedlicska 5b3076b775 Merge branch 'main' of github.com:specklesystems/speckle-py into delete_requirements 2021-02-11 09:22:43 +01:00
Gergő Jedlicska 16511f8dc0 chore(.gitignore): ignore .vscode folder 2021-02-11 09:19:30 +01:00
Gergő Jedlicska 8a673a54a9 chore(.vscode): remove .vscode folder, this should not be part of version control 2021-02-11 09:18:13 +01:00
izzy lyseggen f98b40cce3 Merge pull request #47 from specklesystems/izzy/doc-fix
docs: small config option for poetry venvs
2021-02-11 09:10:20 +01:00
izzy lyseggen 3a76358557 Merge pull request #48 from specklesystems/izzy/base-validation
☑ Base Attribute Name Validation
2021-02-09 09:51:56 +00:00
izzy lyseggen b6b25f824e test(base): tests for prop validaton 2021-02-05 11:23:25 +00:00
izzy lyseggen aa032895b6 feat(base): add prop validation
addresses #43
2021-02-05 11:23:03 +00:00
izzy lyseggen 6f871f0523 chore: add test launch config 2021-02-05 11:22:25 +00:00
izzy lyseggen 5e7b3712b7 Merge pull request #47 from specklesystems/izzy/doc-fix
docs: small config option for poetry venvs
2021-02-04 16:35:16 +00:00
izzy lyseggen 1db0fca68c docs: small config option for poetry venvs 2021-02-04 16:34:41 +00:00
izzy lyseggen dff3496712 Merge pull request #46 from gjedlicska/python_poetry
Switch to pyproject.toml and Poetry
2021-02-04 16:22:22 +00:00
Gergő Jedlicska dbcb691fbc chore(merge remote master): merged remote main branch. Added pytest-ordering 2021-01-31 10:29:11 +01:00
Gergő Jedlicska 4572d15b10 Merge remote-tracking branch 'upstream/main' into python_poetry 2021-01-31 10:05:13 +01:00
Gergő Jedlicska 779c4e6d70 docs(readme.md): replace Developing & Debugging with poetry instructions
re #44
2021-01-31 07:18:03 +01:00
Gergő Jedlicska 12ba5b347e feat(dependecy management): add basic pyproject.toml definition with python-poetry
This should be compatible with the current requirements.txt dependency definition.

re #44
2021-01-30 18:08:58 +01:00
izzy lyseggen 8dc3355f51 Merge pull request #42 from specklesystems/izzy/source-app
fix(commit): sourceapp change pyspeckle to python
2021-01-27 16:30:08 +00:00
izzy lyseggen 9e095e8673 fix(commit): sourceapp change pyspeckle to python
to be consistent with the other connectors
2021-01-27 16:27:04 +00:00
izzy lyseggen 089c10facd Merge pull request #41 from specklesystems/izzy/point-example
🔹 Implement `Point` example class (from core objects)
2021-01-26 11:53:25 +00:00
izzy lyseggen 236d53f78a feat(obj): finish point example 2021-01-26 11:49:36 +00:00
izzy lyseggen 257c32665e Merge pull request #40 from specklesystems/izzy/base-props
😇 Base Object Improvements
2021-01-26 10:37:04 +00:00
izzy lyseggen 82f7ee6f0a test(objects&serialisation): new base features 2021-01-26 10:04:00 +00:00
izzy lyseggen 748faf277d feat(serialiser): check defined detachable props 2021-01-26 10:02:55 +00:00
izzy lyseggen 90f5e7602c feat(base): add units prop with helper setter 2021-01-26 10:01:45 +00:00
izzy lyseggen 6b4dc9a6b2 fix(object): step into 'data' in get response 2021-01-26 09:53:56 +00:00
izzy lyseggen efa8c46b61 fix(receive): step into 'data' for server receive 2021-01-26 09:53:26 +00:00
izzy lyseggen 9527425c38 Merge pull request #39 from specklesystems/izzy/local-db
🗃 Default to SQLiteTransport as local transport
2021-01-21 15:38:08 +00:00
izzy lyseggen 6ab9252398 test(serialisation): both sqlite & server receive 2021-01-21 15:33:06 +00:00
izzy lyseggen 661c25c8fb test: smol tidy 2021-01-21 15:24:02 +00:00
izzy lyseggen 28ee9ec201 refactor(transports): comment out sqlite wip 2021-01-21 15:23:38 +00:00
izzy lyseggen 6155962bd8 feat(operations): swap out mem for sqlite transport 2021-01-21 15:23:24 +00:00
izzy lyseggen 607ad2c721 fix(models): make ServerInfo fields optional 2021-01-21 15:22:23 +00:00
izzy lyseggen 7866e1082e Merge pull request #38 from specklesystems/izzy/gql-stuff
🕸 More GQL Queries!
2021-01-21 12:16:10 +00:00
izzy lyseggen 0bd4b3b093 refactor(stream): remove unused importts 2021-01-21 12:10:59 +00:00
izzy lyseggen 94f47eeb17 test(user): user provile updates 2021-01-21 12:10:44 +00:00
izzy lyseggen 11fee54d36 feat(user): user update 2021-01-21 12:09:50 +00:00
izzy lyseggen b6943bbe6f test(server): api token create and revoke 2021-01-21 11:54:45 +00:00
izzy lyseggen 8b25fa1470 feat(server): api token create and revoke 2021-01-21 11:54:36 +00:00
izzy lyseggen 617e202a02 refactor(credentials): move ServerInfo to models 2021-01-21 11:33:18 +00:00
izzy lyseggen 76da3cacfb test(server): server get and apps 2021-01-21 11:32:46 +00:00
izzy lyseggen b3e9f425c0 feat(server): parse ServerInfo response 2021-01-21 11:32:37 +00:00
izzy lyseggen 739837bad2 test: reoder test execution 2021-01-21 11:07:27 +00:00
izzy lyseggen 0110b5b11a test(user): get and search 2021-01-21 11:07:08 +00:00
izzy lyseggen 0d31337350 test(stream): grant and revoke permissions 2021-01-21 11:06:01 +00:00
izzy lyseggen 12eb88819e test: add additional test user 2021-01-21 11:05:39 +00:00
izzy lyseggen 3d7d138841 feat(stream): grant and revoke permissions 2021-01-21 11:04:27 +00:00
izzy lyseggen 60bc4df16a test(commit): list query 2021-01-21 09:42:48 +00:00
izzy lyseggen d99c05761d test(branch): update and delete queries 2021-01-21 09:38:59 +00:00
izzy lyseggen dc326e6c6b feat(branch): update and delete queries 2021-01-21 09:38:47 +00:00
izzy lyseggen eb10e93300 fix(branch): adjust list query 2021-01-21 09:20:08 +00:00
izzy lyseggen 64434cd7f5 test(branch): get and list queries 2021-01-21 09:16:11 +00:00
izzy lyseggen 35a121abd9 feat(branch): get and list queries 2021-01-21 09:16:11 +00:00
izzy lyseggen fe5e7b19b0 Merge pull request #37 from specklesystems/izzy/accounts-fix
fix(credentials): adjust defs for py3.6 compat
2021-01-21 09:14:21 +00:00
izzy lyseggen adae615e29 fix(credentials): adjust defs for py3.6 compat 2021-01-21 09:12:26 +00:00
izzy lyseggen 203230fd8b Merge pull request #36 from specklesystems/izzy/ci-matrix-tests
🤖 ci: run tests for py 3.6 - 3.9
2021-01-20 17:03:24 +00:00
izzy lyseggen 64df2f241c ci: run tests for py 3.6 - 3.9 2021-01-20 16:57:49 +00:00
izzy lyseggen 110f10623e Merge pull request #35 from specklesystems/izzy/3.6-compat
fix: remove annotations for py 3.6 compatibility
2021-01-20 16:55:40 +00:00
izzy lyseggen 4dda9b8fe5 fix: remove annotations for py 3.6 compatibility 2021-01-20 16:53:48 +00:00
izzy lyseggen f494a663de Merge pull request #34 from specklesystems/izzy/ci
 setting up ci: take 2 
2021-01-19 17:22:26 +00:00
izzy lyseggen ff44f4ecb1 test: oops forgot to switch to testing.speckle.dev 2021-01-19 17:20:22 +00:00
izzy lyseggen 8da5086419 ci: upgrade pip and remove double pytest 2021-01-19 17:06:26 +00:00
izzy lyseggen f46dd7e0c6 ci: remove test args 2021-01-19 17:03:30 +00:00
izzy lyseggen dac3a86bcc ci: i'm dumb and spelled config wrong 2021-01-19 17:01:29 +00:00
izzy lyseggen c7a603ad45 Merge pull request #33 from specklesystems/revert-32-izzy/ci
Revert "setting up ci"
2021-01-19 17:00:24 +00:00
izzy lyseggen aaaf323b43 Revert "setting up ci" 2021-01-19 16:58:20 +00:00
izzy lyseggen 0173e76c76 Merge pull request #32 from specklesystems/izzy/ci
setting up ci
2021-01-19 16:57:35 +00:00
izzy lyseggen 3c2a437f98 ci: not sure what i'm doing tbh 2021-01-19 16:50:08 +00:00
izzy lyseggen 282623ce10 Merge pull request #31 from specklesystems/izzy/tests
🧫 Groundwork for testing: GQL queries and serialisation
2021-01-19 16:02:27 +00:00
izzy lyseggen 0409f2c0f3 test(object): create and get 2021-01-19 15:57:08 +00:00
izzy lyseggen 12528205f5 test(branch): test create 2021-01-19 15:56:55 +00:00
izzy lyseggen 063191e961 docs(object): update docstring 2021-01-19 15:56:38 +00:00
izzy lyseggen f9da5422c6 fix(branch): specify create return type 2021-01-19 15:55:52 +00:00
izzy lyseggen 41e66dda0d chore: requirements & formatting 2021-01-19 12:01:05 +00:00
izzy lyseggen 5eee3fee07 TEMPfix(serialisation): get around server bug
will revert when fix available for specklesystems/speckle-server#78
2021-01-19 11:05:42 +00:00
izzy lyseggen e14c42dfd1 test(serialisation): they work, yo 🥳 2021-01-19 11:04:34 +00:00
izzy lyseggen 062808c568 test: move fixtures to conf for sharing 2021-01-19 11:03:03 +00:00
izzy lyseggen 8b9f2db176 test: refactor into classes to use ordering 2021-01-19 11:02:11 +00:00
izzy lyseggen 5b458c630e test(commits): cleanup 2021-01-19 09:30:18 +00:00
izzy lyseggen 25c4b35eb3 test(serialisation): basic and chunking 2021-01-19 09:30:18 +00:00
izzy lyseggen 21b1b2c30a test(commits): scaffold tests 2021-01-19 09:30:18 +00:00
izzy lyseggen 1a063bbbf7 test(streams): small fixes 2021-01-19 09:30:18 +00:00
izzy lyseggen beb550624e test(streams): client stream operations 2021-01-19 09:30:18 +00:00
izzy lyseggen 50c6e2c840 test(config): set up tests with local server 2021-01-19 09:30:18 +00:00
izzy lyseggen 3f986fced3 Merge pull request #30 from specklesystems/izzy/dynamic-chunking
🧨 Dynamic prop chunking
2021-01-19 09:29:28 +00:00
izzy lyseggen ca234536bc feat(chunking): dynamic chunking with @() syntax
closes #24
2021-01-19 09:28:12 +00:00
izzy lyseggen f155129f7c feat(base): dynamic chunk default (1000) 2021-01-19 09:26:42 +00:00
izzy lyseggen 37d628d27b Merge pull request #29 from specklesystems/izzy/commit-queries
🧜‍♀️ Update Commit Models & Queries
2021-01-18 15:45:49 +00:00
izzy lyseggen 7b6e0aa6ed feat(commits): update queries and models 2021-01-18 15:43:58 +00:00
izzy lyseggen 2d449a328b Merge pull request #28 from specklesystems/izzy/base-props
🥠 Support for properties
2021-01-18 15:28:12 +00:00
izzy lyseggen ad47f649db feat(serializer): support deserialising of props 2021-01-18 15:27:43 +00:00
izzy lyseggen 750657db19 feat(base): bypass setattr for prop setters 2021-01-18 15:27:29 +00:00
izzy lyseggen 453a2e4211 Merge pull request #27 from specklesystems/izzy/smol-fixes
docs(objects): update docstring & add example obj
2021-01-18 11:44:22 +00:00
izzy lyseggen 2ca184538d docs(objects): update docstring & add example obj 2021-01-18 11:43:19 +00:00
Matteo Cominetti 79a832360b Merge pull request #22 from specklesystems/docs
feat: removes links to slack
2021-01-06 16:49:06 +00:00
Matteo Cominetti b2945ad3ff feat: removes links to slack 2021-01-06 16:48:45 +00:00
izzy lyseggen 3e7b620e1e Merge pull request #17 from specklesystems/izzy/chunking
🍰 Chunking of long lists
2020-12-24 11:45:06 +00:00
izzy lyseggen 028ca641ef fix(serialisation): some quick fixes 2020-12-24 11:38:44 +00:00
izzy lyseggen 11bc10d072 feat(base): get id method 2020-12-24 11:37:47 +00:00
izzy lyseggen 28e68e090c fix(objects): remove duplicate prop defs 2020-12-23 18:32:37 +00:00
izzy lyseggen 6eb73555ed feat(objects): mesh obj for chunk testing 2020-12-23 18:32:37 +00:00
izzy lyseggen e6727a9552 fix(chunking): delay chunk check to handle_value 2020-12-23 18:32:37 +00:00
izzy lyseggen b36e7e000f feat(chunking): initial chunking implementation 2020-12-23 18:32:36 +00:00
izzy lyseggen 2dba909eba feat(objects): import all obj classes 2020-12-23 18:32:36 +00:00
izzy lyseggen 21abd5181a fix(base): make chunkable prop protected 2020-12-23 18:32:36 +00:00
izzy lyseggen 969b6a92e5 fix(memory): remove redundant serialisation 2020-12-23 18:32:36 +00:00
izzy lyseggen 77dcf53c4b feat(chunking): add DataChunk class 2020-12-23 18:32:36 +00:00
izzy lyseggen 7fbfdb4b92 fix(base): always use class name for string repr 2020-12-23 18:32:36 +00:00
izzy lyseggen a4f7ce326e feat(Base): add chunks prop 2020-12-23 18:32:36 +00:00
izzy lyseggen a3830a95fd feat(Base): self populate speckleType 2020-12-23 18:32:36 +00:00
izzy lyseggen 78068d0098 fix(transports): inherit from ABC
fix(transports): inherit from `ABC`
2020-12-23 18:32:09 +00:00
izzy lyseggen 36d5abf7d4 fix(transports): inherit from ABC 2020-12-23 18:31:00 +00:00
izzy lyseggen bce4490882 Merge pull request #18 from gjedlicska/deffered_type_hints
refactor(abstract_transport): add deferred type hints
2020-12-23 18:28:56 +00:00
izzy lyseggen 6d4fc17b4c Merge branch 'main' into deffered_type_hints 2020-12-23 18:28:09 +00:00
izzy lyseggen 827df8e574 Merge pull request #20 from specklesystems/izzy/transports-refactor
refactor(transports): inherit from `BaseModel`
2020-12-23 18:24:23 +00:00
izzy lyseggen 075d77fea6 refactor(transports): inherit from BaseModel
resolves #19
2020-12-23 18:21:33 +00:00
Gergő Jedlicska 6b276243de mend 2020-12-23 18:42:22 +01:00
Gergő Jedlicska e671a6d086 refactor(abstract_transport.py): added deffered type hints to AbstractTransport
Python type hint evaluation can be deffered by enclosing the type hint in quotes. This renders the
Transport class useless, while still keeping the functionality. Plus you asked for it :D
2020-12-23 17:40:58 +01:00
izzy lyseggen 824c0d8401 Merge pull request #16 from specklesystems/izzy/fix-base
fix(Base): rename `speckleType` 👉 `speckle_type`
2020-12-22 11:29:31 +00:00
izzy lyseggen 48e4ad1e93 feat(models): some string overrides 2020-12-22 11:27:37 +00:00
izzy lyseggen cf2c9d12a5 fix(Base): speckleType 👉 speckle_type 2020-12-22 11:27:21 +00:00
Matteo Cominetti 578ffdb8c5 Merge pull request #15 from specklesystems/osx
Osx
2020-12-09 15:46:27 +00:00
Matteo Cominetti f58c13c0d1 Merge commit 'c8210342c2a6f9097fc00bd8e04a7d198ab3e2ce' into osx 2020-12-09 15:45:30 +00:00
izzy lyseggen c8210342c2 Merge pull request #14 from specklesystems/izzy/docs-links
📘 docs: updates and add links to forum
2020-12-09 12:56:24 +00:00
izzy lyseggen c6d6a3e025 docs: updates and add links to forum 2020-12-09 12:55:48 +00:00
izzy lyseggen ba7911bcf5 Merge pull request #3 from specklesystems/izzy/transports
🏄‍♀️ Server transport
2020-12-09 12:22:41 +00:00
izzy lyseggen 2e428f9b3c feat(server): raise exception for get_object()
this is not implemented. direct user to use the client
2020-12-09 12:20:19 +00:00
izzy lyseggen 3c8aff3487 feat(server): wip get obj 2020-12-09 12:16:50 +00:00
izzy lyseggen 9657bd370c feat(server): save obj from transport 2020-12-09 12:16:50 +00:00
izzy lyseggen fd0d04b70e feat(server): successfully receive objects! 2020-12-09 12:16:50 +00:00
izzy lyseggen 7310fbfdd4 fix(abstract transport): typo 2020-12-09 12:16:50 +00:00
izzy lyseggen 90cae9a3c5 fix(memory): return string obj from get 2020-12-09 12:16:50 +00:00
izzy lyseggen 01091405d1 fix(serialiser): extra checks for errors 2020-12-09 12:16:50 +00:00
izzy lyseggen cff738aa31 feat(transports): wip server transport 2020-12-09 12:16:50 +00:00
izzy lyseggen 30a3cd8f05 Merge pull request #13 from specklesystems/izzy/host-input
🧼 fix(client): sanitise host input
2020-12-09 12:15:54 +00:00
izzy lyseggen c9746a6d57 fix(client): sanitise host input
remove protocol and trailing slash
2020-12-09 12:14:23 +00:00
izzy lyseggen 251f8fb330 Merge pull request #12 from specklesystems/izzy/fix-errormsg
🏮 fix(exceptions): add string override
2020-12-09 11:41:38 +00:00
izzy lyseggen 0b74502dd7 fix(exceptions): add string override
do classes no longer default to the `__repr__` override?
to investigate...
2020-12-09 11:38:58 +00:00
izzy lyseggen a06e682698 Merge pull request #10 from specklesystems/izzy/fix-macospath
💾 fix(sqlite): get correct db base path on macos
2020-12-09 09:24:02 +00:00
izzy lyseggen f258de4794 fix(sqlite): get correct db base path on macos
closes #9
2020-12-09 09:22:13 +00:00
Matteo Cominetti 9320b566f3 docs: adds venv instructions for unix systems 2020-12-08 10:57:53 +00:00
izzy lyseggen 79ac5366a6 docs: fix some typos 2020-12-07 17:42:17 +00:00
izzy lyseggen 6cc909ddd9 Merge pull request #8 from specklesystems/izzy/docs
📘 Basic documentation in readme
2020-12-07 11:44:13 +00:00
izzy lyseggen 0dca458a0a docs: some more comments 2020-12-07 11:42:24 +00:00
izzy lyseggen e92562ccf3 docs: more samples and text descriptions 2020-12-07 11:35:21 +00:00
izzy lyseggen 6ae95e0f9c docs: wip add some code samples 2020-12-07 10:52:57 +00:00
izzy lyseggen 32954964f0 Merge pull request #7 from specklesystems/izzy/gql
🎁 More gql functions
2020-12-07 10:07:43 +00:00
izzy lyseggen 2f8ecf7430 feat(object): object get and create 2020-12-07 10:06:46 +00:00
izzy lyseggen ad0a01c5ce fix(commit): add return type to create 2020-12-07 10:06:15 +00:00
izzy lyseggen def3d3c27b feat(commit): update and delete 2020-12-07 09:41:42 +00:00
izzy lyseggen 6cde8d6e8a feat(commits): commit create 2020-12-07 09:30:50 +00:00
izzy lyseggen d63d24201e feat(gql): add some commit and obj functions 2020-12-04 15:55:51 +00:00
izzy lyseggen dd5b355305 fix(base): speckle_type 👉 speckleType 2020-12-04 15:54:45 +00:00
izzy lyseggen db7ef190fd Merge pull request #4 from specklesystems/izzy/accounts
🙋‍♀️ Get local accounts
2020-12-02 09:52:41 +00:00
izzy lyseggen c20c805e19 feat(accounts): handle if no default found 2020-12-02 09:45:13 +00:00
izzy lyseggen 665f6b8c32 feat(accounts): get all local and default accounts 2020-12-02 09:37:37 +00:00
izzy lyseggen 9f5c453228 feat(sqlite): get correct path on diff platforms 2020-12-02 09:37:02 +00:00
izzy lyseggen 3d7fc85a79 Merge pull request #2 from specklesystems/izzy/transports
🥣 Serialisation and a start on transports
2020-12-01 17:14:10 +00:00
izzy lyseggen 99a80ba85e feat(operations): add checks for null remote 2020-12-01 15:14:44 +00:00
izzy lyseggen 5d059b6770 feat(transports): pass get obj None checks to user
also adds copy obj and children method
2020-12-01 15:11:02 +00:00
izzy lyseggen ee22740a93 feat(serialisation): check for tuples 2020-12-01 14:45:46 +00:00
izzy lyseggen 0e2105c56e feat(sqlite): make connection and queue private 2020-12-01 08:52:55 +00:00
izzy lyseggen 1d7b120f26 feat(deserialisation): from memory transport 2020-11-30 19:00:37 +00:00
izzy lyseggen b00cc3d08e feat(base): to_dict convenience method 2020-11-30 18:39:24 +00:00
izzy lyseggen de4ea698b8 feat(serialisation): update detach helper 2020-11-30 16:59:31 +00:00
izzy lyseggen 91bf8c111d feat(base): add string override 2020-11-30 16:43:09 +00:00
izzy lyseggen 72dfd4807e feat(serialization): simplify logic and align with core
only allow detaching of base objects
2020-11-30 16:42:24 +00:00
izzy lyseggen e2079ff6a9 fix(memory): typo in memory transport 2020-11-30 10:41:57 +00:00
izzy lyseggen cb5cbeaad6 feat(base): allow kwargs in initialisation 2020-11-30 10:12:07 +00:00
izzy lyseggen 18744d218a fix(serialization): match referencedId prop name 2020-11-30 09:37:21 +00:00
izzy lyseggen 5f05e9853f feat(serialization): hook up with transports 2020-11-27 18:32:42 +00:00
izzy lyseggen 7295689e12 feat(operations): implement send 2020-11-27 18:31:33 +00:00
izzy lyseggen 09ce21e475 docs(serialization): function descriptions 2020-11-27 16:17:39 +00:00
izzy lyseggen 3ff444aa52 refactor(serialisation): clean up traverse_base 2020-11-27 15:21:11 +00:00
izzy lyseggen 799d9428ec fix(serialisation): closures in lists/dicts 2020-11-27 14:40:16 +00:00
izzy lyseggen ea8be095ed feat(serialization): handle nested base objects
base objects in lists and dicts

TODO: fix closures on these nested base objects
2020-11-26 19:27:53 +00:00
izzy lyseggen 135c7215f5 feat(exceptions): add SerializationException 2020-11-26 18:26:05 +00:00
izzy lyseggen eee726e252 feat(serialisation): closures & handle iterables
- add '__closures' to each object
- construct the full closure table as dict
- handle lists and dicts as detachable child objects
2020-11-26 18:25:44 +00:00
izzy lyseggen 79dba3318f refactor(serialisation): simplify loop 2020-11-26 11:51:29 +00:00
izzy lyseggen 60d253343c fix(serialization): write detached or root obj
to transport. keep non-detached objects saved within the parent only
2020-11-26 10:26:27 +00:00
izzy lyseggen 2ea43d54d6 fix(serialization): fix the final object key order 2020-11-26 09:51:08 +00:00
izzy lyseggen 37480b1c9e feat(serialization): create closure table 2020-11-25 22:04:48 +00:00
izzy lyseggen b1660d5dbf feat(serialiZation): wip traversing base dict 2020-11-25 20:05:05 +00:00
izzy lyseggen 8b48167dca feat(ops): scaffolding 2020-11-25 20:01:44 +00:00
izzy lyseggen f3dbddb6e1 feat(transports): memory transport 2020-11-25 11:30:32 +00:00
izzy lyseggen 19da6c0f5f feat(transports): begin and end write functions 2020-11-25 11:30:17 +00:00
izzy lyseggen a8c75b0000 feat(transports): wip sqlite transport
not quite working how i want yet
2020-11-24 09:19:52 +00:00
izzy lyseggen 4e8c3cbb08 feat(transports): abstract base 2020-11-23 18:33:03 +00:00
izzy lyseggen d01d7824bc feat(base): get total children count 2020-11-19 16:02:32 +00:00
izzy lyseggen f643ee8e89 refactor(base): simplify get_dynamic_member_names 2020-11-19 11:58:28 +00:00
izzy lyseggen 9a27ed1544 feat(base): start Base object with dict set/get 2020-11-19 09:24:13 +00:00
195 changed files with 16404 additions and 3931 deletions
+70
View File
@@ -0,0 +1,70 @@
version: 2.1
orbs:
python: circleci/python@2.0.3
codecov: codecov/codecov@3.2.2
jobs:
test:
machine:
image: ubuntu-2204:2023.02.1
docker_layer_caching: true
resource_class: medium
parameters:
tag:
default: "3.11"
type: string
steps:
- checkout
- run:
name: Install python
command: |
pyenv install -s << parameters.tag >>
pyenv global << parameters.tag >>
- run:
name: Startup the Speckle Server
command: docker compose -f docker-compose.yml up -d
- run:
name: Install Poetry
command: |
pip install poetry
- run:
name: Install packages
command: poetry install
- run:
name: Run tests
command: poetry run pytest --cov --cov-report xml:reports/coverage.xml --junitxml=reports/test-results.xml
- store_test_results:
path: reports
- store_artifacts:
path: reports
- codecov/upload
deploy:
docker:
- image: "cimg/python:3.8"
steps:
- checkout
- run: python patch_version.py $CIRCLE_TAG
- run: poetry build
- run: poetry publish -u __token__ -p $PYPI_TOKEN
workflows:
main:
jobs:
- test:
matrix:
parameters:
tag: ["3.11"]
filters:
tags:
only: /.*/
- deploy:
context: pypi
requires:
- test
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/ # For testing only! /ci\/.*/
+27
View File
@@ -0,0 +1,27 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/blob/main/containers/python-3/.devcontainer/base.Dockerfile
# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
ARG VARIANT="3.10"
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="16"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
# COPY requirements.txt /tmp/pip-tmp/
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
# && rm -rf /tmp/pip-tmp
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
USER vscode
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
ENV PATH=$PATH:$HOME/.poetry/env
+55
View File
@@ -0,0 +1,55 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.191.1/containers/python-3
{
"name": "Python 3",
// "build": {
// "dockerfile": "Dockerfile",
// "context": "..",
// "args": {
// // Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
// "VARIANT": "3.6",
// // Options
// "NODE_VERSION": "lts/*"
// }
// },
"dockerComposeFile": "./docker-compose.yaml",
"service": "specklepy",
"workspaceFolder": "/workspaces/specklepy",
"shutdownAction": "stopCompose",
// Set *default* container specific settings.json values on container create.
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.pylintArgs": [
"--max-line-length=120"
],
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
"python.testing.pytestArgs": [
"tests/",
"-s"
],
"python.testing.pytestEnabled": true,
"editor.formatOnSave": true,
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "poetry config virtualenvs.create false && poetry install",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
+44
View File
@@ -0,0 +1,44 @@
version: "3.3" # optional since v1.27.0
services:
postgres:
image: cimg/postgres:14.2
environment:
POSTGRES_DB: speckle2_test
POSTGRES_PASSWORD: speckle
POSTGRES_USER: speckle
network_mode: host
redis:
image: cimg/redis:6.2
network_mode: host
speckle-server:
image: speckle/speckle-server:latest
command: ["bash", "-c", "/wait && node bin/www"]
environment:
POSTGRES_URL: "localhost"
POSTGRES_USER: "speckle"
POSTGRES_PASSWORD: "speckle"
POSTGRES_DB: "speckle2_test"
REDIS_URL: "redis://localhost"
SESSION_SECRET: "keyboard cat"
STRATEGY_LOCAL: "true"
CANONICAL_URL: "http://localhost:3000"
WAIT_HOSTS: localhost:5432, localhost:6379
DISABLE_FILE_UPLOADS: "true"
network_mode: host
specklepy:
build:
dockerfile: Dockerfile
context: .
args:
VARIANT: 3.9
NODE_VERSION: lts/*
volumes:
# Mounts the project folder to '/workspace'. While this file is in .devcontainer,
# mounts are relative to the first file in the list, which is a level up.
- ..:/workspaces/specklepy:cached
# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"
network_mode: host
# networks:
# default:
+3
View File
@@ -0,0 +1,3 @@
* text=auto eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
+12 -11
View File
@@ -1,4 +1,5 @@
# Speckle Contribution Guidelines
## Introduction
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).
🙌❤️💙💚💜🙌
-25
View File
@@ -1,25 +0,0 @@
---
name: New issue
about: Create a report to help us improve
title:
labels:
assignees:
---
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!
+113
View File
@@ -0,0 +1,113 @@
---
name: Bug report
about: Help improve Speckle!
title: ''
labels: bug
assignees: ''
---
<!---
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!
-->
+71
View File
@@ -0,0 +1,71 @@
---
name: Feature request
about: Suggest an idea for Speckle!
title: ''
labels: enhancement, question
assignees: ''
---
<!---
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/
-->
@@ -1,25 +0,0 @@
Description of PR...
## Changes
- Item 1
- Item 2
## Checklist
- [ ] Unit tests
- [ ] Documentation
## References
(optional)
Include **important** links regarding the implementation of this PR.
This usually includes and RFC or an aggregation of issues and/or individual conversations
that helped put this solution together. This helps ensure there is a good aggregation
of resources regarding the implementation.
```text
Fixes #85, Fixes #22, Fixes username/repo#123
Connects #123
```
+102
View File
@@ -0,0 +1,102 @@
<!---
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..
-->
+5 -1
View File
@@ -1,3 +1,7 @@
.tool-versions
.envrc
reports/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
@@ -108,4 +112,4 @@ venv.bak/
# other
scratch.py
settings.json
settings.json
+33
View File
@@ -0,0 +1,33 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
hooks:
- id: ruff
rev: v0.0.186
- repo: https://github.com/commitizen-tools/commitizen
hooks:
- id: commitizen
- id: commitizen-branch
stages:
- push
rev: v2.38.0
- repo: https://github.com/pycqa/isort
rev: v5.11.3
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
# language_version: python3.11
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
+12 -1
View File
@@ -4,6 +4,8 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
@@ -11,6 +13,15 @@
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false
},
{
"name": "Pytest",
"type": "python",
"request": "launch",
"program": "pytest",
"args": [],
"console": "integratedTerminal",
"justMyCode": true
}
]
}
}
+76 -17
View File
@@ -1,35 +1,94 @@
# speckle-py 🥧
<h1 align="center">
<img src="https://user-images.githubusercontent.com/2679513/131189167-18ea5fe1-c578-47f6-9785-3748178e4312.png" width="150px"/><br/>
Speckle | specklepy 🐍
</h1>
<h3 align="center">
The Python SDK
</h3>
<p align="center"><b>Speckle</b> is the data infrastructure for the AEC industry.</p><br/>
[![Twitter Follow](https://img.shields.io/twitter/follow/SpeckleSystems?style=social)](https://twitter.com/SpeckleSystems) [![Discourse users](https://img.shields.io/discourse/users?server=https%3A%2F%2Fdiscourse.speckle.works&style=flat-square)](https://discourse.speckle.works)
[![Slack Invite](https://img.shields.io/badge/-slack-grey?style=flat-square&logo=slack)](https://speckle-works.slack.com/join/shared_invite/enQtNjY5Mzk2NTYxNTA4LTU4MWI5ZjdhMjFmMTIxZDIzOTAzMzRmMTZhY2QxMmM1ZjVmNzJmZGMzMDVlZmJjYWQxYWU0MWJkYmY3N2JjNGI) [![website](https://img.shields.io/badge/www-speckle.systems-royalblue?style=flat-square)](https://speckle.systems)
<p align="center"><a href="https://twitter.com/SpeckleSystems"><img src="https://img.shields.io/twitter/follow/SpeckleSystems?style=social" alt="Twitter Follow"></a> <a href="https://speckle.community"><img src="https://img.shields.io/discourse/users?server=https%3A%2F%2Fspeckle.community&amp;style=flat-square&amp;logo=discourse&amp;logoColor=white" alt="Community forum users"></a> <a href="https://speckle.systems"><img src="https://img.shields.io/badge/https://-speckle.systems-royalblue?style=flat-square" alt="website"></a> <a href="https://speckle.guide/dev/"><img src="https://img.shields.io/badge/docs-speckle.guide-orange?style=flat-square&amp;logo=read-the-docs&amp;logoColor=white" alt="docs"></a></p>
<p align="center"><a href="https://github.com/specklesystems/specklepy/"><img src="https://circleci.com/gh/specklesystems/specklepy.svg?style=svg&amp;circle-token=76eabd350ea243575cbb258b746ed3f471f7ac29" alt="Speckle-Next"></a><a href="https://codecov.io/gh/specklesystems/specklepy">
<img src="https://codecov.io/gh/specklesystems/specklepy/branch/main/graph/badge.svg?token=8KQFL5N0YF"/>
</a> </p>
## Introduction
# About Speckle
> ⚠ 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+ ⚠
What is Speckle? Check our ![YouTube Video Views](https://img.shields.io/youtube/views/B9humiSpHzM?label=Speckle%20in%201%20minute%20video&style=social)
### Features
- **Object-based:** say goodbye to files! Speckle is the first object based platform for the AEC industry
- **Version control:** Speckle is the Git & Hub for geometry and BIM data
- **Collaboration:** share your designs collaborate with others
- **3D Viewer:** see your CAD and BIM models online, share and embed them anywhere
- **Interoperability:** get your CAD and BIM models into other software without exporting or importing
- **Real time:** get real time updates and notifications and changes
- **GraphQL API:** get what you need anywhere you want it
- **Webhooks:** the base for a automation and next-gen pipelines
- **Built for developers:** we are building Speckle with developers in mind and got tools for every stack
- **Built for the AEC industry:** Speckle connectors are plugins for the most common software used in the industry such as Revit, Rhino, Grasshopper, AutoCAD, Civil 3D, Excel, Unreal Engine, Unity, QGIS, Blender and more!
### Try Speckle now!
Give Speckle a try in no time by:
- [![speckle XYZ](https://img.shields.io/badge/https://-speckle.xyz-0069ff?style=flat-square&logo=hackthebox&logoColor=white)](https://speckle.xyz) ⇒ creating an account at our public server
- [![create a droplet](https://img.shields.io/badge/Create%20a%20Droplet-0069ff?style=flat-square&logo=digitalocean&logoColor=white)](https://marketplace.digitalocean.com/apps/speckle-server?refcode=947a2b5d7dc1) ⇒ deploying an instance in 1 click
### Resources
- [![Community forum users](https://img.shields.io/badge/community-forum-green?style=for-the-badge&logo=discourse&logoColor=white)](https://speckle.community) for help, feature requests or just to hang with other speckle enthusiasts, check out our community forum!
- [![website](https://img.shields.io/badge/tutorials-speckle.systems-royalblue?style=for-the-badge&logo=youtube)](https://speckle.systems) our tutorials portal is full of resources to get you started using Speckle
- [![docs](https://img.shields.io/badge/docs-speckle.guide-orange?style=for-the-badge&logo=read-the-docs&logoColor=white)](https://speckle.guide/dev/) reference on almost any end-user and developer functionality
# Repo structure
## Usage
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 python-poetry for dependency management, make sure you follow the official [docs](https://python-poetry.org/docs/#installation) to get poetry.
To bootstrap the project environment run `$ poetry install`. This will create a new virtual-env for the project and install both the package and dev dependencies.
If this is your first time using poetry and you're used to creating your venvs within the project directory, run `poetry config virtualenvs.in-project true` to configure poetry to do the same.
To execute any python script run `$ poetry run python my_script.py`
> Alternatively you may roll your own virtual-env with either venv, virtualenv, pyenv-virtualenv etc. Poetry will play along an recognize if it is invoked from inside a virtual environment.
### Style guide
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.
### Local Data Paths
It may be helpful to know where the local accounts and object cache dbs are stored. Depending on on your OS, you can find the dbs at:
- 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.
## License
+12
View File
@@ -0,0 +1,12 @@
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| 2.2.+ | :white_check_mark: |
| < 2.2 | :x: |
## Reporting a Vulnerability
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!
+162
View File
@@ -0,0 +1,162 @@
version: "3.9"
name: "speckle-server"
services:
####
# Speckle Server dependencies
#######
postgres:
image: "postgres:14.5-alpine"
restart: always
environment:
POSTGRES_DB: speckle
POSTGRES_USER: speckle
POSTGRES_PASSWORD: speckle
volumes:
- postgres-data:/var/lib/postgresql/data/
healthcheck:
# the -U user has to match the POSTGRES_USER value
test: ["CMD-SHELL", "pg_isready -U speckle"]
interval: 5s
timeout: 5s
retries: 30
redis:
image: "redis:6.0-alpine"
restart: always
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 5s
timeout: 5s
retries: 30
minio:
image: "minio/minio"
command: server /data --console-address ":9001"
restart: always
volumes:
- minio-data:/data
healthcheck:
test:
[
"CMD-SHELL",
"curl -s -o /dev/null http://127.0.0.1:9000/minio/index.html",
]
interval: 5s
timeout: 30s
retries: 30
start_period: 10s
####
# Speckle Server
#######
speckle-frontend:
image: speckle/speckle-frontend:latest
restart: always
ports:
- "0.0.0.0:8080:8080"
environment:
FILE_SIZE_LIMIT_MB: 100
speckle-server:
image: speckle/speckle-server:latest
restart: always
healthcheck:
test:
[
"CMD",
"node",
"-e",
"require('node:http').request({headers: {'Content-Type': 'application/json'}, port:3000, hostname:'127.0.0.1', path:'/graphql?query={serverInfo{version}}', method: 'GET' }, (res) => { body = ''; res.on('data', (chunk) => {body += chunk;}); res.on('end', () => {process.exit(res.statusCode != 200 || body.toLowerCase().includes('error'));}); }).end();",
]
interval: 10s
timeout: 3s
retries: 30
ports:
- "0.0.0.0:3000:3000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_healthy
environment:
# TODO: Change this to the URL of the speckle server, as accessed from the network
CANONICAL_URL: "http://127.0.0.1:8080"
SPECKLE_AUTOMATE_URL: "http://127.0.0.1:3030"
# TODO: Change thvolumes:
REDIS_URL: "redis://redis"
S3_ENDPOINT: "http://minio:9000"
S3_ACCESS_KEY: "minioadmin"
S3_SECRET_KEY: "minioadmin"
S3_BUCKET: "speckle-server"
S3_CREATE_BUCKET: "true"
FILE_SIZE_LIMIT_MB: 100
# TODO: Change this to a unique secret for this server
SESSION_SECRET: "TODO:ReplaceWithLongString"
STRATEGY_LOCAL: "true"
DEBUG: "speckle:*"
POSTGRES_URL: "postgres"
POSTGRES_USER: "speckle"
POSTGRES_PASSWORD: "speckle"
POSTGRES_DB: "speckle"
ENABLE_MP: "false"
preview-service:
image: speckle/speckle-preview-service:latest
restart: always
depends_on:
speckle-server:
condition: service_healthy
mem_limit: "1000m"
memswap_limit: "1000m"
environment:
DEBUG: "preview-service:*"
PG_CONNECTION_STRING: "postgres://speckle:speckle@postgres/speckle"
webhook-service:
image: speckle/speckle-webhook-service:latest
restart: always
depends_on:
speckle-server:
condition: service_healthy
environment:
DEBUG: "webhook-service:*"
PG_CONNECTION_STRING: "postgres://speckle:speckle@postgres/speckle"
WAIT_HOSTS: postgres:5432
fileimport-service:
image: speckle/speckle-fileimport-service:latest
restart: always
depends_on:
speckle-server:
condition: service_healthy
environment:
DEBUG: "fileimport-service:*"
PG_CONNECTION_STRING: "postgres://speckle:speckle@postgres/speckle"
WAIT_HOSTS: postgres:5432
S3_ENDPOINT: "http://minio:9000"
S3_ACCESS_KEY: "minioadmin"
S3_SECRET_KEY: "minioadmin"
S3_BUCKET: "speckle-server"
SPECKLE_SERVER_URL: "http://speckle-server:3000"
networks:
default:
name: speckle-server
volumes:
postgres-data:
redis-data:
minio-data:
+63
View File
@@ -0,0 +1,63 @@
import os
import random
import string
import time
from pathlib import Path
from typing import List
from specklepy.api import operations
from specklepy.objects import Base
from specklepy.transports.sqlite import SQLiteTransport
class Sub(Base):
bar: List[str]
def random_string():
letters = string.ascii_lowercase
return "".join(random.choice(letters) for _ in range(10))
BASE_PATH = SQLiteTransport.get_base_path("Speckle")
def clean_db():
os.remove(Path(BASE_PATH, "Objects.db"))
def one_pass(clean: bool, randomize: bool, child_count: int):
foo = Base()
for i in range(child_count):
stuff = random_string() if randomize else "stuff"
foo[f"@child_{i}"] = Sub(bar=["asdf", "bar", i, stuff])
if clean:
clean_db()
transport = SQLiteTransport()
start = time.time()
hash = operations.send(base=foo, transports=[transport])
send_time = time.time() - start
receive_start = time.time()
operations.receive(hash, transport)
receive_time = time.time() - receive_start
return send_time, receive_time
if __name__ == "__main__":
sample_size = 4
test_permutations = [
(True, True),
(False, False),
(False, True),
(True, False),
]
for clean, randomize in test_permutations:
print(f"CLEAN: {clean}, RANDOMIZE: {randomize}")
for child_count in [10, 100, 1000, 10000]:
print(f"\tCHILD COUNT: {child_count}")
for _ in range(sample_size):
send_time, receive_time = one_pass(clean, randomize, child_count)
print(f"\t\tSend: {send_time} Receive: {receive_time}")
+15
View File
@@ -0,0 +1,15 @@
from devtools import debug
from specklepy.api import operations
from specklepy.api.wrapper import StreamWrapper
if __name__ == "__main__":
stream_url = "https://latest.speckle.dev/streams/7d051a6449"
wrapper = StreamWrapper(stream_url)
transport = wrapper.get_transport()
rec = operations.receive("98396753f8bf7fe1cb60c5193e9f9d86", transport)
# hash = operations.send(base=foo, transports=[transport], use_default_cache=False)
debug(rec)
+39
View File
@@ -0,0 +1,39 @@
import random
import string
from typing import List
from specklepy.api import operations
from specklepy.api.wrapper import StreamWrapper
from specklepy.objects import Base
class Sub(Base):
bar: List[str]
def random_string():
letters = string.ascii_lowercase
return "".join(random.choice(letters) for _ in range(10))
def create_object(child_count: int) -> Base:
foo = Base()
for i in range(child_count):
stuff = random_string()
foo[f"@child_{i}"] = Sub(bar=["asdf", "bar", i, stuff])
return foo
if __name__ == "__main__":
stream_url = "http://hyperion:3000/streams/2372b54c35"
child_count = 10
foo = create_object(child_count)
wrapper = StreamWrapper(stream_url)
transport = wrapper.get_transport()
hash = operations.send(base=foo, transports=[transport], use_default_cache=False)
rec = operations.receive(hash, transport)
print(rec)
+36
View File
@@ -0,0 +1,36 @@
from devtools import debug
from specklepy.api import operations
from specklepy.objects.geometry import Base
from specklepy.objects.units import Units
dct = {
"id": "1234abcd",
"units": None,
"speckle_type": "Base",
"applicationId": None,
"totalChildrenCount": 0,
}
base = Base()
for prop, value in dct.items():
base.__setattr__(prop, value)
debug(base)
debug(base.units)
base.units = "m"
debug(base.units)
base.units = None
debug(base.units)
foo = operations.serialize(base)
base.units = 10
debug(base.units)
debug(foo)
base.units = Units.mm
debug(base.units)
+60
View File
@@ -0,0 +1,60 @@
"""This is an example showcasing the usage of speckle `Base` class."""
# the speckle.objects module exposes all speckle provided classes
from devtools import debug
from specklepy.api import operations
from specklepy.objects import Base
class ExampleSub(Base):
"""
Inheriting from `Base` is done with in the standard way by default.
The syntax is similar to the stdlib dataclass syntax.
No __init__ method definition is required, that is done automatically by the base
type. Also the attributes defined this way are instance attributes despite they
might look like class attributes.
The speckle Base uses the pydantic BaseModel in the background, but ideally that
is not the consumers concern.
**Important note:** currently the way how serialization works, requires
each attribute to have a valid default value, just like `foo` has. This includes
default values for all primitives and complex datastructures.
Failing to provide a default, breaks the receiving end of the transport.
"""
foo: str = "bar"
class SpeckleSub(ExampleSub, speckle_type="custom_speckle_sub"):
"""
Example custom type name registration.
This is an optional feature.
The default value of the speckle_type is generated from the name of the class, but
optionally it may be overridden. This is useful, since the speckle_type has to be
unique for each subclass of speckle Base.
"""
magic: str = "trick"
if __name__ == "__main__":
# example usage
custom_sub = SpeckleSub(
foo=123,
magic="trick",
bar="baric",
extra=123,
)
# support for dynamic attributes
custom_sub.extra_extra = "what is this?"
debug(custom_sub)
serialized = operations.serialize(custom_sub)
deserialized = operations.deserialize(serialized)
# the only difference should be between the two data is that the deserialized
# instance id attribute is not None.
debug(deserialized)
+31
View File
@@ -0,0 +1,31 @@
import re
import sys
def patch(tag):
print(f"Patching version: {tag}")
with open("pyproject.toml", "r") as f:
lines = f.readlines()
if "version" not in lines[2]:
raise Exception("Invalid pyproject.toml. Could not patch version.")
lines[2] = f'version = "{tag}"\n'
with open("pyproject.toml", "w") as file:
file.writelines(lines)
def main():
if len(sys.argv) < 2:
return
tag = sys.argv[1]
if not re.match(r"[0-9]+(\.[0-9]+)*$", tag):
raise ValueError(f"Invalid tag provided: {tag}")
patch(tag)
if __name__ == "__main__":
main()
Generated
+1802
View File
File diff suppressed because it is too large Load Diff
+73
View File
@@ -0,0 +1,73 @@
[tool.poetry]
name = "specklepy"
version = "2.9.1"
description = "The Python SDK for Speckle 2.0"
readme = "README.md"
authors = ["Speckle Systems <devops@speckle.systems>"]
license = "Apache-2.0"
repository = "https://github.com/specklesystems/speckle-py"
documentation = "https://speckle.guide/dev/py-examples.html"
homepage = "https://speckle.systems/"
packages = [
{ include = "specklepy", from = "src" },
{ include = "speckle_automate", from = "src" },
]
[tool.poetry.dependencies]
python = ">=3.8.0, <4.0"
pydantic = "^2.0"
appdirs = "^1.4.4"
gql = {extras = ["requests", "websockets"], version = "^3.3.0"}
ujson = "^5.3.0"
Deprecated = "^1.2.13"
stringcase = "^1.2.0"
attrs = "^23.1.0"
httpx = "^0.25.0"
[tool.poetry.group.dev.dependencies]
black = "^22.8.0"
isort = "^5.7.0"
pytest = "^7.1.3"
pytest-ordering = "^0.6"
pytest-cov = "^3.0.0"
devtools = "^0.8.0"
pylint = "^2.14.4"
mypy = "^0.982"
pre-commit = "^2.20.0"
commitizen = "^2.38.0"
ruff = "^0.0.187"
types-deprecated = "^1.2.9"
types-ujson = "^5.6.0.0"
types-requests = "^2.28.11.5"
[tool.black]
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
include = '\.pyi?$'
line-length = 88
target-version = ["py37", "py38", "py39", "py310", "py311"]
[tool.commitizen]
name = "cz_conventional_commits"
version = "2.9.2"
tag_format = "$version"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.isort]
profile = "black"
-31
View File
@@ -1,31 +0,0 @@
aiohttp==3.7.1
appdirs==1.4.4
astroid==2.4.2
async-timeout==3.0.1
attrs==20.3.0
black==20.8b1
certifi==2020.11.8
chardet==3.0.4
click==7.1.2
colorama==0.4.4
gql==3.0.0a4
graphql-core==3.1.2
idna==2.10
isort==5.6.4
lazy-object-proxy==1.4.3
mccabe==0.6.1
multidict==5.0.0
mypy-extensions==0.4.3
pathspec==0.8.1
pydantic==1.7.2
pylint==2.6.0
regex==2020.11.11
requests==2.24.0
six==1.15.0
toml==0.10.2
typed-ast==1.4.1
typing-extensions==3.7.4.3
urllib3==1.25.11
websockets==8.1
wrapt==1.12.1
yarl==1.5.1
-85
View File
@@ -1,85 +0,0 @@
from gql.client import SyncClientSession
from speckle.logging.exceptions import SpeckleException
from typing import Dict
from speckle.api import resources
from speckle.api.resources import stream, server, user, subscriptions
from gql import Client, gql
from gql.transport.requests import RequestsHTTPTransport
from gql.transport.aiohttp import AIOHTTPTransport
from gql.transport.websockets import WebsocketsTransport
class SpeckleClient:
DEFAULT_HOST = "staging.speckle.dev"
USE_SSL = True
def __init__(self, host: str = DEFAULT_HOST, use_ssl: bool = USE_SSL) -> None:
ws_protocol = "ws"
http_protocol = "http"
if use_ssl:
ws_protocol = "wss"
http_protocol = "https"
self.url = f"{http_protocol}://{host}"
self.graphql = self.url + "/graphql"
self.ws_url = f"{ws_protocol}://{host}/graphql"
self.me = None
self.httpclient = Client(
transport=RequestsHTTPTransport(url=self.graphql, verify=True, retries=3)
)
self.wsclient = None
self._init_resources()
def authenticate(self, token: str) -> None:
"""Authenticate the client using a personal access token
The token is saved in the client object and a synchronous GraphQL entrypoint is created
Arguments:
token {str} -- an api token
"""
self.me = {"token": token}
headers = {
"Authorization": f"Bearer {self.me['token']}",
"Content-Type": "application/json",
}
httptransport = RequestsHTTPTransport(
url=self.graphql, headers=headers, verify=True, retries=3
)
wstransport = WebsocketsTransport(
url=self.ws_url,
init_payload={"Authorization": f"Bearer {self.me['token']}"},
)
self.httpclient = Client(transport=httptransport)
self.wsclient = Client(transport=wstransport)
self._init_resources()
def execute_query(self, query: str) -> Dict:
return self.httpclient.execute(query)
def _init_resources(self) -> None:
self.stream = stream.Resource(
me=self.me, basepath=self.url, client=self.httpclient
)
self.server = server.Resource(
me=self.me, basepath=self.url, client=self.httpclient
)
self.user = user.Resource(me=self.me, basepath=self.url, client=self.httpclient)
self.subscribe = subscriptions.Resource(
me=self.me,
basepath=self.ws_url,
client=self.wsclient,
)
def __getattr__(self, name):
try:
attr = getattr(resources, name)
return attr.Resource(me=self.me, basepath=self.url, client=self.httpclient)
except:
raise SpeckleException(
f"Method {name} is not supported by the SpeckleClient class"
)
-86
View File
@@ -1,86 +0,0 @@
# generated by datamodel-codegen:
# filename: stream_schema.json
# timestamp: 2020-11-17T14:33:13+00:00
from __future__ import annotations
from datetime import datetime
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class Collaborator(BaseModel):
id: Optional[str]
name: Optional[str]
role: Optional[str]
avatar: Optional[str]
class Commit(BaseModel):
id: Optional[str]
message: Optional[str]
authorName: Optional[str]
authorId: Optional[str]
authorAvatar: Optional[str]
createdAt: Optional[str]
referencedObject: Optional[str]
class Commits(BaseModel):
totalCount: Optional[int]
cursor: Optional[Any]
items: List[Commit] = []
class Object(BaseModel):
id: Optional[str]
speckleType: Optional[str]
applicationId: Optional[str]
totalChildrenCount: Optional[int]
createdAt: Optional[str]
class Branch(BaseModel):
id: Optional[str]
name: Optional[str]
description: Optional[str]
commits: Optional[Commits]
class Branches(BaseModel):
totalCount: Optional[int]
cursor: Optional[datetime]
items: List[Branch] = []
class Streams(BaseModel):
totalCount: Optional[int]
cursor: Optional[datetime]
items: List[Stream] = []
class Stream(BaseModel):
id: Optional[str]
name: Optional[str]
description: Optional[str]
isPublic: Optional[bool]
createdAt: Optional[str]
updatedAt: Optional[str]
collaborators: List[Collaborator] = []
branches: Optional[Branches]
commit: Optional[Commit]
object: Optional[Object]
class User(BaseModel):
id: Optional[str]
email: Optional[str]
name: Optional[str]
bio: Optional[str]
company: Optional[str]
avatar: Optional[str]
verified: Optional[bool]
role: Optional[str]
streams: Optional[Streams]
-76
View File
@@ -1,76 +0,0 @@
from logging import error
from speckle.logging.exceptions import GraphQLException, SpeckleException
from typing import Dict, List
from gql.client import Client
from gql.gql import gql
from gql.transport.exceptions import TransportQueryError
class ResourceBase(object):
def __init__(
self,
me: Dict,
basepath: str,
client: Client,
name: str,
methods: list,
) -> None:
self.me = me
self.basepath = basepath
self.client = client
self.name = name
self.methods = methods
self.schema = None
def _step_into_response(self, response: dict, return_type: str or List):
"""Step into the dict to get the relevant data"""
if return_type is None:
return response
elif isinstance(return_type, str):
return response[return_type]
elif isinstance(return_type, List):
for key in return_type:
response = response[key]
return response
def _parse_response(self, response: dict or list, schema=None):
"""Try to create a class instance from the response"""
if isinstance(response, list):
return [self._parse_response(response=r, schema=schema) for r in response]
if schema:
return schema.parse_obj(response)
elif self.schema:
return self.schema.parse_obj(response)
else:
return response
def make_request(
self,
query: gql,
params: Dict = None,
return_type: str or List = None,
schema=None,
parse_response: bool = True,
) -> Dict or GraphQLException:
"""Executes the GraphQL query"""
try:
response = self.client.execute(query, variable_values=params)
except Exception as e:
if isinstance(e, TransportQueryError):
return GraphQLException(
message=f"Failed to execute the GraphQL {self.name} request. Errors: {e.errors}",
errors=e.errors,
data=e.data,
)
else:
return SpeckleException(
message=f"Failed to execute the GraphQL {self.name} request. Inner exception: {e}",
exception=e,
)
response = self._step_into_response(response=response, return_type=return_type)
if parse_response:
return self._parse_response(response=response, schema=schema)
else:
return response
-48
View File
@@ -1,48 +0,0 @@
from typing import List, Optional
from gql import gql
from pydantic.main import BaseModel
from speckle.api.resource import ResourceBase
from speckle.api.models import Branch
NAME = "branch"
METHODS = ["create"]
class Resource(ResourceBase):
"""API Access class for branches"""
def __init__(self, me, basepath, client) -> None:
super().__init__(
me=me, basepath=basepath, client=client, name=NAME, methods=METHODS
)
self.schema = Branch
def create(
self, streamId: str, name: str, description: str = "No description provided"
) -> str:
"""Create a new branch on this stream
Arguments:
name {str} -- the name of the new branch
description {str} -- a short description of the branch
Returns:
id {str} -- the newly created branch's id
"""
query = gql(
"""
mutation BranchCreate($branch: BranchCreateInput!){
branchCreate(branch: $branch)
}
"""
)
params = {
"branch": {
"streamId": streamId,
"name": name,
"description": description,
}
}
return self.make_request(query=query, params=params, parse_response=False)
-19
View File
@@ -1,19 +0,0 @@
from typing import Optional, List
from gql import gql
from pydantic.main import BaseModel
from speckle.api.resource import ResourceBase
from speckle.api.models import Commit
NAME = "commit"
METHODS = []
class Resource(ResourceBase):
"""API Access class for commits"""
def __init__(self, me, basepath, client) -> None:
super().__init__(
me=me, basepath=basepath, client=client, name=NAME, methods=METHODS
)
self.schema = Commit
-79
View File
@@ -1,79 +0,0 @@
from typing import Dict
from gql import gql
from gql.client import Client
from speckle.api.resource import ResourceBase
NAME = "server"
METHODS = ["get", "apps"]
class Resource(ResourceBase):
"""API Access class for the server"""
def __init__(self, me, basepath, client) -> None:
super().__init__(
me=me, basepath=basepath, client=client, name=NAME, methods=METHODS
)
def get(self) -> Dict:
"""Get the server info
Returns:
dict -- the server info in dictionary form
"""
query = gql(
"""
query Server {
serverInfo {
name
company
description
adminContact
canonicalUrl
roles {
name
description
resourceTarget
}
scopes {
name
description
}
authStrategies{
id
name
icon
}
}
}
"""
)
return self.make_request(query=query)
def apps(self) -> Dict:
"""Get the apps registered on the server
Returns:
dict -- a dictionary of apps registered on the server
"""
query = gql(
"""
query Apps {
apps {
id
name
description
termsAndConditionsLink
logo
author {
id
name
}
}
}
"""
)
return self.make_request(query=query)
-298
View File
@@ -1,298 +0,0 @@
from re import search
from typing import Dict, List, Optional
from pydantic import BaseModel
from gql import gql
from speckle.api.resource import ResourceBase
from speckle.api.models import Stream
from speckle.logging.exceptions import GraphQLException
NAME = "stream"
METHODS = [
"list",
"create",
"get",
"update",
"delete",
"search",
]
class Resource(ResourceBase):
"""API Access class for streams"""
def __init__(self, me, basepath, client) -> None:
super().__init__(
me=me, basepath=basepath, client=client, name=NAME, methods=METHODS
)
self.schema = Stream
def get(self, id: str, branch_limit: int = 10, commit_limit: int = 10) -> Stream:
"""Get the specified stream from the server
Arguments:
id {str} -- the stream id
branch_limit {int} -- the maximum number of branches to return
commit_limit {int} -- the maximum number of commits to return
Returns:
Stream -- the retrieved stream
"""
query = gql(
"""
query Stream($id: String!, $branch_limit: Int!, $commit_limit: Int!) {
stream(id: $id) {
id
name
description
isPublic
createdAt
updatedAt
collaborators {
id
name
role
avatar
}
branches(limit: $branch_limit) {
totalCount
cursor
items {
id
name
description
commits(limit: $commit_limit) {
totalCount
cursor
items {
id
referencedObject
message
authorName
authorId
createdAt
}
}
}
}
}
}
"""
)
params = {"id": id, "branch_limit": branch_limit, "commit_limit": commit_limit}
return self.make_request(query=query, params=params, return_type="stream")
def list(self, stream_limit: int = 10) -> List[Stream]:
"""Get a list of the user's streams
Arguments:
stream_limit {int} -- The maximum number of streams to return
Returns:
List[Stream] -- A list of Stream objects
"""
query = gql(
"""
query User($stream_limit: Int!) {
user {
id
email
name
bio
company
avatar
verified
profiles
role
streams(limit: $stream_limit) {
totalCount
cursor
items {
id
name
description
isPublic
createdAt
updatedAt
collaborators {
id
name
role
}
}
}
}
}
"""
)
params = {"stream_limit": stream_limit}
return self.make_request(
query=query, params=params, return_type=["user", "streams", "items"]
)
def create(
self,
name: str = "Anonymous Python Stream",
description: str = "No description provided",
is_public: bool = True,
) -> str:
"""Create a new stream
Arguments:
name {str} -- the name of the string
description {str} -- a short description of the stream
is_public {bool} -- whether or not the stream can be viewed by anyone with the id
Returns:
id {str} -- the id of the newly created stream
"""
query = gql(
"""
mutation StreamCreate($stream: StreamCreateInput!) {
streamCreate(stream: $stream)
}
"""
)
params = {
"stream": {"name": name, "description": description, "isPublic": is_public}
}
return self.make_request(
query=query, params=params, return_type="streamCreate", parse_response=False
)
def update(
self, id: str, name: str = None, description: str = None, is_public: bool = None
) -> bool:
"""Update an existing stream
Arguments:
id {str} -- the id of the stream to be updated
name {str} -- the name of the string
description {str} -- a short description of the stream
is_public {bool} -- whether or not the stream can be viewed by anyone with the id
Returns:
bool -- whether the stream update was successful
"""
query = gql(
"""
mutation StreamUpdate($stream: StreamUpdateInput!) {
streamUpdate(stream: $stream)
}
"""
)
params = {
"id": id,
"name": name,
"description": description,
"isPublic": is_public,
}
# remove None values so graphql doesn't cry
params = {"stream": {k: v for k, v in params.items() if v is not None}}
return self.make_request(
query=query, params=params, return_type="streamUpdate", parse_response=False
)
def delete(self, id: str) -> bool:
"""Delete a stream given its id
Arguments:
id {str} -- the id of the stream to delete
Returns:
bool -- whether the deletion was successful
"""
query = gql(
"""
mutation StreamDelete($id: String!) {
streamDelete(id: $id)
}
"""
)
params = {"id": id}
return self.make_request(
query=query, params=params, return_type="streamDelete", parse_response=False
)
def search(
self,
search_query: str,
limit: int = 25,
branch_limit: int = 10,
commit_limit: int = 10,
):
"""Search for streams by name, description, or id
Arguments:
search_query {str} -- a string to search for
limit {int} -- the maximum number of results to return
branch_limit {int} -- the maximum number of branches to return
commit_limit {int} -- the maximum number of commits to return
Returns:
List[Stream] -- a list of Streams that match the search query
"""
query = gql(
"""
query StreamSearch($search_query: String!,$limit: Int!, $branch_limit:Int!, $commit_limit:Int!) {
streams(query: $search_query, limit: $limit) {
items {
id
name
description
isPublic
createdAt
updatedAt
collaborators {
id
name
role
avatar
}
branches(limit: $branch_limit) {
totalCount
cursor
items {
id
name
description
commits(limit: $commit_limit) {
totalCount
cursor
items {
id
referencedObject
message
authorName
authorId
createdAt
}
}
}
}
}
}
}
"""
)
params = {
"search_query": search_query,
"limit": limit,
"branch_limit": branch_limit,
"commit_limit": commit_limit,
}
return self.make_request(
query=query, params=params, return_type=["streams", "items"]
)
-86
View File
@@ -1,86 +0,0 @@
from speckle.logging.exceptions import SpeckleException
from typing import List, Optional
from gql import gql
from pydantic.main import BaseModel
from speckle.api.resource import ResourceBase
from speckle.api.models import User
NAME = "user"
METHODS = ["get"]
class Resource(ResourceBase):
"""API Access class for users"""
def __init__(self, me, basepath, client) -> None:
super().__init__(
me=me, basepath=basepath, client=client, name=NAME, methods=METHODS
)
self.schema = User
def get(self, id: str = None) -> User:
"""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).
Arguments:
id {str} -- the user id
Returns:
User -- the retrieved user
"""
query = gql(
"""
query User($id: String) {
user(id: $id) {
id
email
name
bio
company
avatar
verified
profiles
role
}
}
"""
)
params = {"id": id}
return self.make_request(query=query, params=params, return_type="user")
def search(self, search_query: str, limit: int = 25) -> List[User]:
"""Searches for user by name or email. The search query must be at least 3 characters long
Arguments:
search_query {str} -- a string to search for
limit {int} -- the maximum number of results to return
Returns:
List[User] -- a list of User objects that match the search query
"""
if len(search_query) < 3:
return SpeckleException(
message="User search query must be at least 3 characters"
)
query = gql(
"""
query UserSearch($search_query: String!, $limit: Int!) {
userSearch(query: $search_query, limit: $limit) {
items {
id
name
bio
company
avatar
verified
}
}
}
"""
)
params = {"search_query": search_query, "limit": limit}
return self.make_request(
query=query, params=params, return_type=["userSearch", "items"]
)
-640
View File
@@ -1,640 +0,0 @@
scalar DateTime
scalar EmailAddress
scalar BigInt
scalar JSONObject
directive @hasScope(scope: String!) on FIELD_DEFINITION
directive @hasRole(role: String!) on FIELD_DEFINITION
type Query {
"""
Stare into the void.
"""
_: String
}
type Mutation{
"""
The void stares back.
"""
_: String
}
type Subscription{
"""
It's lonely in the void.
"""
_: String
},extend type Query {
"""
Gets a specific app from the server.
"""
app( id: String! ): ServerApp
"""
Returns all the publicly available apps on this server.
"""
apps: [ServerAppListItem]
}
type ServerApp {
id: String!
secret: String!
name: String!
description: String
termsAndConditionsLink: String
logo: String
public: Boolean
trustByDefault: Boolean
author: AppAuthor
createdAt: DateTime!
redirectUrl: String!
scopes: [Scope]!
}
type ServerAppListItem {
id: String!
name: String!
description: String
termsAndConditionsLink: String
logo: String
author: AppAuthor
}
type AppAuthor {
name: String
id: String
}
extend type User {
"""
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")
}
extend type Mutation {
"""
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")
}
input AppCreateInput {
name: String!
description: String!
termsAndConditionsLink: String
logo: String
public: Boolean
redirectUrl: String!
scopes: [String]!
}
input AppUpdateInput {
id: String!
name: String!
description: String!
termsAndConditionsLink: String
logo: String
public: Boolean
redirectUrl: String!
scopes: [String]!
}
,extend type ServerInfo {
"""
The authentication strategies available on this server.
"""
authStrategies: [AuthStrategy]
}
type AuthStrategy {
id: String!,
name: String!,
icon: String!,
url: String!,
color: String
}
,extend type User{
"""
Returns a list of your personal api tokens.
"""
apiTokens: [ApiToken]
@hasRole(role: "server:user")
@hasScope(scope: "tokens:read")
}
type ApiToken {
id: String!
name: String!
lastChars: String!
scopes: [String]!
createdAt: DateTime! #date
lifespan: BigInt!
lastUsed: String! #date
}
input ApiTokenCreateInput {
scopes: [String!]!,
name: String!,
lifespan: BigInt
}
extend type Mutation {
"""
Creates an personal api token.
"""
apiTokenCreate(token: ApiTokenCreateInput!):String!
@hasRole(role: "server:user")
@hasScope(scope: "tokens:write")
"""
Revokes (deletes) an personal api token.
"""
apiTokenRevoke(token: String!):Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "tokens:write")
}
,extend type Stream {
commits(limit: Int! = 25, cursor: String): CommitCollection
commit(id: String!): Commit
branches(limit: Int! = 25, cursor: String): BranchCollection
branch(name: String!): Branch
}
extend type User {
commits(limit: Int! = 25, cursor: String): CommitCollectionUser
}
type Branch {
id: String!
name: String!
author: User!
description: String
commits(limit: Int! = 25, cursor: String): CommitCollection
}
type Commit {
id: String!
referencedObject: String!
message: String
authorName: String
authorId: String
createdAt: DateTime
}
type CommitCollectionUserNode {
id: String!
referencedObject: String!
message: String
streamId: String
streamName: String
createdAt: DateTime
}
type BranchCollection {
totalCount: Int!
cursor: String
items: [Branch]
}
type CommitCollection {
totalCount: Int!
cursor: String
items: [Commit]
}
type CommitCollectionUser {
totalCount: Int!
cursor: String
items: [CommitCollectionUserNode]
}
extend type Mutation {
branchCreate(branch: BranchCreateInput!): String!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
branchUpdate(branch: BranchUpdateInput!): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
branchDelete(branch: BranchDeleteInput!): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
commitCreate(commit: CommitCreateInput!): String!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
commitUpdate(commit: CommitUpdateInput!): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
commitDelete(commit: CommitDeleteInput!): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
}
extend type Subscription {
# TODO: auth for these subscriptions
"""
Subscribe to branch created event
"""
branchCreated(streamId: String!): JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
"""
Subscribe to branch updated event.
"""
branchUpdated(streamId: String!, branchId: String): JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
"""
Subscribe to branch deleted event
"""
branchDeleted(streamId: String!): JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
"""
Subscribe to commit created event
"""
commitCreated(streamId: String!): JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
"""
Subscribe to commit updated event.
"""
commitUpdated(streamId: String!, commitId: String): JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
"""
Subscribe to commit deleted event
"""
commitDeleted(streamId: String!): JSONObject
@hasRole(role: "server:user")
@hasScope(scope: "streams:read")
}
input BranchCreateInput {
streamId: String!
name: String!
description: String
}
input BranchUpdateInput {
streamId: String!
id: String!
name: String
description: String
}
input BranchDeleteInput {
streamId: String!
id: String!
}
input CommitCreateInput {
streamId: String!
branchName: String!
objectId: String!
message: String
previousCommitIds: [String]
}
input CommitUpdateInput {
streamId: String!
id: String!
message: String!
}
input CommitDeleteInput {
streamId: String!
id: String!
}
,extend type Stream {
object( id: String! ): Object
}
type Object {
id: String!
speckleType: String!
applicationId: String
createdAt: DateTime
totalChildrenCount: Int
"""
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.
"""
children(
limit: Int! = 100,
depth: Int! = 50,
select: [String],
cursor: String,
query: [JSONObject!],
orderBy: JSONObject ): ObjectCollection!
}
type ObjectCollection {
totalCount: Int!
cursor: String
objects: [Object]!
}
extend type Mutation {
objectCreate( objectInput: ObjectCreateInput! ): [String]!
}
input ObjectCreateInput {
"""
The stream against which these objects will be created.
"""
streamId: String!
"""
The objects you want to create.
"""
objects: [JSONObject]!
},extend type Query {
serverInfo: ServerInfo!
}
"""
Information about this server.
"""
type ServerInfo {
name: String!
company: String
description: String
adminContact: String
canonicalUrl: String
termsOfService: String
roles: [Role]!
scopes: [Scope]!
}
"""
Available roles.
"""
type Role {
name: String!
description: String!
resourceTarget: String!
}
"""
Available scopes.
"""
type Scope {
name: String!
description: String!
}
extend type Mutation {
serverInfoUpdate(info: ServerInfoUpdateInput!): Boolean
@hasRole(role: "server:admin")
@hasScope(scope: "server:setup")
}
input ServerInfoUpdateInput {
name: String!
company: String
description: String
adminContact: String
termsOfService: String
}
,extend type Query {
"""
Returns a specific stream.
"""
stream( id: String! ): Stream
"""
All the streams of the current user, pass in the `query` parameter to seach by name, description or ID.
"""
streams( query: String, limit: Int = 25, cursor: String ): StreamCollection
@hasScope(scope: "streams:read")
}
type Stream {
id: String!
name: String!
description: String
isPublic: Boolean!
createdAt: DateTime!
updatedAt: DateTime!
collaborators: [ StreamCollaborator ]!
}
extend type User {
"""
All the streams that a user has access to.
"""
streams( limit: Int! = 25, cursor: String ): StreamCollection
}
type StreamCollaborator {
id: String!
name: String!
role: String!
company: String
avatar: String
}
type StreamCollection {
totalCount: Int!
cursor: String
items: [ Stream ]
}
extend type Mutation {
"""
Creates a new stream.
"""
streamCreate( stream: StreamCreateInput! ): String
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
"""
Updates an existing stream.
"""
streamUpdate( stream: StreamUpdateInput! ): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
"""
Deletes an existing stream.
"""
streamDelete( id: String! ): Boolean!
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
"""
Grants permissions to a user on a given stream.
"""
streamGrantPermission( permissionParams: StreamGrantPermissionInput! ): Boolean
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
"""
Revokes the permissions of a user on a given stream.
"""
streamRevokePermission( permissionParams: StreamRevokePermissionInput! ): Boolean
@hasRole(role: "server:user")
@hasScope(scope: "streams:write")
}
extend type Subscription {
#
# 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")
}
input StreamCreateInput {
name: String
description: String
isPublic: Boolean
}
input StreamUpdateInput {
id: String!
name: String
description: String
isPublic: Boolean
}
input StreamGrantPermissionInput {
streamId: String!,
userId: String!,
role: String!
}
input StreamRevokePermissionInput {
streamId: String!,
userId: String!
}
,extend type Query {
"""
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).
"""
user(id: String): User
userSearch(
query: String!
limit: Int! = 25
cursor: String
): UserSearchResultCollection
userPwdStrength(pwd: String!): JSONObject
}
"""
Base user type.
"""
type User {
id: String!
suuid: String
email: String
name: String
bio: String
company: String
avatar: String
verified: Boolean
profiles: JSONObject
role: String
}
type UserSearchResultCollection {
cursor: String
items: [UserSearchResult]
}
type UserSearchResult {
id: String!
name: String
bio: String
company: String
avatar: String
verified: Boolean
}
extend type Mutation {
"""
Edits a user's profile.
"""
userUpdate(user: UserUpdateInput!): Boolean!
}
input UserUpdateInput {
name: String
company: String
bio: String
}
-17
View File
@@ -1,17 +0,0 @@
from typing import List
class SpeckleException(Exception):
def __init__(self, message: str, exception: Exception = None) -> None:
self.message = message
self.exception = exception
def __repr__(self) -> str:
return f"SpeckleException: {self.message}"
class GraphQLException(SpeckleException):
def __init__(self, message: str, errors: List, data=None) -> None:
super().__init__(message=message)
self.errors = errors
self.data = data
-51
View File
@@ -1,51 +0,0 @@
# generated by datamodel-codegen:
# filename: Beam.json
# timestamp: 2020-11-24T16:33:00+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Beam(BaseModel):
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-51
View File
@@ -1,51 +0,0 @@
# generated by datamodel-codegen:
# filename: Brace.json
# timestamp: 2020-11-24T16:33:02+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Brace(BaseModel):
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-52
View File
@@ -1,52 +0,0 @@
# generated by datamodel-codegen:
# filename: Column.json
# timestamp: 2020-11-24T16:33:04+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Column(BaseModel):
height: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-57
View File
@@ -1,57 +0,0 @@
# generated by datamodel-codegen:
# filename: Duct.json
# timestamp: 2020-11-24T16:33:07+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Duct(BaseModel):
width: Optional[float] = None
height: Optional[float] = None
diameter: Optional[float] = None
length: Optional[float] = None
level: Optional[Level] = None
velocity: Optional[float] = None
system: Optional[Optional[str]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-51
View File
@@ -1,51 +0,0 @@
# generated by datamodel-codegen:
# filename: Element.json
# timestamp: 2020-11-24T16:33:08+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Element(BaseModel):
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-56
View File
@@ -1,56 +0,0 @@
# generated by datamodel-codegen:
# filename: Floor.json
# timestamp: 2020-11-24T16:33:10+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class ICurve(BaseModel):
__root__: Optional[Dict[str, Any]]
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Floor(BaseModel):
holes: Optional[List[ICurve]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
@@ -1,67 +0,0 @@
# generated by datamodel-codegen:
# filename: GridLine.json
# timestamp: 2020-11-24T16:33:12+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Interval(BaseModel):
start: Optional[Optional[float]] = None
end: Optional[Optional[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Line(BaseModel):
value: Optional[List[float]] = None
domain: Optional[Interval] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class GridLine(BaseModel):
baseLine: Optional[Line] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-40
View File
@@ -1,40 +0,0 @@
# generated by datamodel-codegen:
# filename: Level.json
# timestamp: 2020-11-24T16:33:15+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-51
View File
@@ -1,51 +0,0 @@
# generated by datamodel-codegen:
# filename: Opening.json
# timestamp: 2020-11-24T16:33:18+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Opening(BaseModel):
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-56
View File
@@ -1,56 +0,0 @@
# generated by datamodel-codegen:
# filename: Roof.json
# timestamp: 2020-11-24T16:33:33+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class ICurve(BaseModel):
__root__: Optional[Dict[str, Any]]
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Roof(BaseModel):
holes: Optional[List[ICurve]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-59
View File
@@ -1,59 +0,0 @@
# generated by datamodel-codegen:
# filename: Room.json
# timestamp: 2020-11-24T16:33:34+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class ICurve(BaseModel):
__root__: Optional[Dict[str, Any]]
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Room(BaseModel):
number: Optional[Optional[str]] = None
area: Optional[float] = None
volume: Optional[float] = None
holes: Optional[List[ICurve]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
@@ -1,28 +0,0 @@
# generated by datamodel-codegen:
# filename: Topography.json
# timestamp: 2020-11-24T16:33:35+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Topography(BaseModel):
baseGeometry: Optional[Mesh] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-52
View File
@@ -1,52 +0,0 @@
# generated by datamodel-codegen:
# filename: Wall.json
# timestamp: 2020-11-24T16:33:37+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Wall(BaseModel):
height: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-61
View File
@@ -1,61 +0,0 @@
# generated by datamodel-codegen:
# filename: Arc.json
# timestamp: 2020-11-24T16:32:59+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Interval(BaseModel):
start: Optional[Optional[float]] = None
end: Optional[Optional[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Point(BaseModel):
value: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Vector(BaseModel):
value: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Plane(BaseModel):
origin: Optional[Point] = None
normal: Optional[Vector] = None
xdir: Optional[Vector] = None
ydir: Optional[Vector] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Arc(BaseModel):
radius: Optional[Optional[float]] = None
startAngle: Optional[Optional[float]] = None
endAngle: Optional[Optional[float]] = None
angleRadians: Optional[Optional[float]] = None
plane: Optional[Plane] = None
domain: Optional[Interval] = None
startPoint: Optional[Point] = None
midPoint: Optional[Point] = None
endPoint: Optional[Point] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-25
View File
@@ -1,25 +0,0 @@
# generated by datamodel-codegen:
# filename: Block.json
# timestamp: 2020-11-24T16:33:01+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Base(BaseModel):
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Block(BaseModel):
description: Optional[Optional[str]] = None
objects: Optional[List[Base]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-56
View File
@@ -1,56 +0,0 @@
# generated by datamodel-codegen:
# filename: Box.json
# timestamp: 2020-11-24T16:33:02+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Interval(BaseModel):
start: Optional[Optional[float]] = None
end: Optional[Optional[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Point(BaseModel):
value: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Vector(BaseModel):
value: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Plane(BaseModel):
origin: Optional[Point] = None
normal: Optional[Vector] = None
xdir: Optional[Vector] = None
ydir: Optional[Vector] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Box(BaseModel):
basePlane: Optional[Plane] = None
xSize: Optional[Interval] = None
ySize: Optional[Interval] = None
zSize: Optional[Interval] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-55
View File
@@ -1,55 +0,0 @@
# generated by datamodel-codegen:
# filename: Circle.json
# timestamp: 2020-11-24T16:33:04+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Interval(BaseModel):
start: Optional[Optional[float]] = None
end: Optional[Optional[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Point(BaseModel):
value: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Vector(BaseModel):
value: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Plane(BaseModel):
origin: Optional[Point] = None
normal: Optional[Vector] = None
xdir: Optional[Vector] = None
ydir: Optional[Vector] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Circle(BaseModel):
radius: Optional[Optional[float]] = None
plane: Optional[Plane] = None
domain: Optional[Interval] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-44
View File
@@ -1,44 +0,0 @@
# generated by datamodel-codegen:
# filename: Curve.json
# timestamp: 2020-11-24T16:33:05+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Interval(BaseModel):
start: Optional[Optional[float]] = None
end: Optional[Optional[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Polyline(BaseModel):
value: Optional[List[float]] = None
closed: Optional[bool] = None
domain: Optional[Interval] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Curve(BaseModel):
degree: Optional[int] = None
periodic: Optional[bool] = None
rational: Optional[bool] = None
points: Optional[List[float]] = None
weights: Optional[List[float]] = None
knots: Optional[List[float]] = None
domain: Optional[Interval] = None
displayValue: Optional[Polyline] = None
closed: Optional[bool] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-56
View File
@@ -1,56 +0,0 @@
# generated by datamodel-codegen:
# filename: Ellipse.json
# timestamp: 2020-11-24T16:33:08+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Interval(BaseModel):
start: Optional[Optional[float]] = None
end: Optional[Optional[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Point(BaseModel):
value: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Vector(BaseModel):
value: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Plane(BaseModel):
origin: Optional[Point] = None
normal: Optional[Vector] = None
xdir: Optional[Vector] = None
ydir: Optional[Vector] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Ellipse(BaseModel):
firstRadius: Optional[Optional[float]] = None
secondRadius: Optional[Optional[float]] = None
plane: Optional[Plane] = None
domain: Optional[Interval] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-39
View File
@@ -1,39 +0,0 @@
# generated by datamodel-codegen:
# filename: Extrusion.json
# timestamp: 2020-11-24T16:33:09+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Base(BaseModel):
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Point(BaseModel):
value: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Extrusion(BaseModel):
length: Optional[Optional[float]] = None
capped: Optional[Optional[bool]] = None
profile: Optional[Base] = None
pathStart: Optional[Point] = None
pathEnd: Optional[Point] = None
pathCurve: Optional[Base] = None
pathTangent: Optional[Base] = None
profiles: Optional[List[Base]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-27
View File
@@ -1,27 +0,0 @@
# generated by datamodel-codegen:
# filename: Line.json
# timestamp: 2020-11-24T16:33:16+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Interval(BaseModel):
start: Optional[Optional[float]] = None
end: Optional[Optional[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Line(BaseModel):
value: Optional[List[float]] = None
domain: Optional[Interval] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-20
View File
@@ -1,20 +0,0 @@
# generated by datamodel-codegen:
# filename: Mesh.json
# timestamp: 2020-11-24T16:33:16+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-36
View File
@@ -1,36 +0,0 @@
# generated by datamodel-codegen:
# filename: Plane.json
# timestamp: 2020-11-24T16:33:19+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Point(BaseModel):
value: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Vector(BaseModel):
value: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Plane(BaseModel):
origin: Optional[Point] = None
normal: Optional[Vector] = None
xdir: Optional[Vector] = None
ydir: Optional[Vector] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-17
View File
@@ -1,17 +0,0 @@
# generated by datamodel-codegen:
# filename: Point.json
# timestamp: 2020-11-24T16:33:20+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Point(BaseModel):
value: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-32
View File
@@ -1,32 +0,0 @@
# generated by datamodel-codegen:
# filename: Polycurve.json
# timestamp: 2020-11-24T16:33:20+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class ICurve(BaseModel):
__root__: Optional[Dict[str, Any]]
class Interval(BaseModel):
start: Optional[Optional[float]] = None
end: Optional[Optional[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Polycurve(BaseModel):
segments: Optional[List[ICurve]] = None
domain: Optional[Interval] = None
closed: Optional[bool] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-28
View File
@@ -1,28 +0,0 @@
# generated by datamodel-codegen:
# filename: Polyline.json
# timestamp: 2020-11-24T16:33:21+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Interval(BaseModel):
start: Optional[Optional[float]] = None
end: Optional[Optional[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Polyline(BaseModel):
value: Optional[List[float]] = None
closed: Optional[bool] = None
domain: Optional[Interval] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-17
View File
@@ -1,17 +0,0 @@
# generated by datamodel-codegen:
# filename: Vector.json
# timestamp: 2020-11-24T16:33:36+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Vector(BaseModel):
value: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-18
View File
@@ -1,18 +0,0 @@
# generated by datamodel-codegen:
# filename: Interval.json
# timestamp: 2020-11-24T16:33:14+00:00
from __future__ import annotations
from typing import Optional
from pydantic import BaseModel
class Interval(BaseModel):
start: Optional[Optional[float]] = None
end: Optional[Optional[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-27
View File
@@ -1,27 +0,0 @@
# generated by datamodel-codegen:
# filename: Interval2d.json
# timestamp: 2020-11-24T16:33:14+00:00
from __future__ import annotations
from typing import Optional
from pydantic import BaseModel
class Interval(BaseModel):
start: Optional[Optional[float]] = None
end: Optional[Optional[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Interval2d(BaseModel):
u: Optional[Interval] = None
v: Optional[Interval] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
@@ -1,54 +0,0 @@
# generated by datamodel-codegen:
# filename: AdaptiveComponent.json
# timestamp: 2020-11-24T16:32:59+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class AdaptiveComponent(BaseModel):
family: Optional[Optional[str]] = None
flipped: Optional[bool] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-22
View File
@@ -1,22 +0,0 @@
# generated by datamodel-codegen:
# filename: DetailCurve.json
# timestamp: 2020-11-24T16:33:06+00:00
from __future__ import annotations
from typing import Any, Dict, Optional
from pydantic import BaseModel
class ICurve(BaseModel):
__root__: Optional[Dict[str, Any]]
class DetailCurve(BaseModel):
baseCurve: Optional[ICurve] = None
lineStyle: Optional[Optional[str]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-94
View File
@@ -1,94 +0,0 @@
# generated by datamodel-codegen:
# filename: DirectShape.json
# timestamp: 2020-11-24T16:33:06+00:00
from __future__ import annotations
from enum import Enum
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class Category(Enum):
integer_0 = 0
integer_1 = 1
integer_2 = 2
integer_3 = 3
integer_4 = 4
integer_5 = 5
integer_6 = 6
integer_7 = 7
integer_8 = 8
integer_9 = 9
integer_10 = 10
integer_11 = 11
integer_12 = 12
integer_13 = 13
integer_14 = 14
integer_15 = 15
integer_16 = 16
integer_17 = 17
integer_18 = 18
integer_19 = 19
integer_20 = 20
integer_21 = 21
integer_22 = 22
integer_23 = 23
integer_24 = 24
integer_25 = 25
integer_26 = 26
integer_27 = 27
integer_28 = 28
integer_29 = 29
integer_30 = 30
integer_31 = 31
integer_32 = 32
integer_33 = 33
integer_34 = 34
integer_35 = 35
integer_36 = 36
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class DirectShape(BaseModel):
category: Optional[Category] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-66
View File
@@ -1,66 +0,0 @@
# generated by datamodel-codegen:
# filename: FamilyInstance.json
# timestamp: 2020-11-24T16:33:10+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Element(BaseModel):
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class FamilyInstance(BaseModel):
family: Optional[Optional[str]] = None
flipped: Optional[bool] = None
host: Optional[Element] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-22
View File
@@ -1,22 +0,0 @@
# generated by datamodel-codegen:
# filename: ModelCurve.json
# timestamp: 2020-11-24T16:33:17+00:00
from __future__ import annotations
from typing import Any, Dict, Optional
from pydantic import BaseModel
class ICurve(BaseModel):
__root__: Optional[Dict[str, Any]]
class ModelCurve(BaseModel):
baseCurve: Optional[ICurve] = None
lineStyle: Optional[Optional[str]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-53
View File
@@ -1,53 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitBeam.json
# timestamp: 2020-11-24T16:33:22+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class RevitBeam(BaseModel):
family: Optional[Optional[str]] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-53
View File
@@ -1,53 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitBrace.json
# timestamp: 2020-11-24T16:33:22+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class RevitBrace(BaseModel):
family: Optional[Optional[str]] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-47
View File
@@ -1,47 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitCategory.json
# timestamp: 2020-11-24T16:33:23+00:00
from __future__ import annotations
from enum import Enum
class RevitCategory(Enum):
integer_0 = 0
integer_1 = 1
integer_2 = 2
integer_3 = 3
integer_4 = 4
integer_5 = 5
integer_6 = 6
integer_7 = 7
integer_8 = 8
integer_9 = 9
integer_10 = 10
integer_11 = 11
integer_12 = 12
integer_13 = 13
integer_14 = 14
integer_15 = 15
integer_16 = 16
integer_17 = 17
integer_18 = 18
integer_19 = 19
integer_20 = 20
integer_21 = 21
integer_22 = 22
integer_23 = 23
integer_24 = 24
integer_25 = 25
integer_26 = 26
integer_27 = 27
integer_28 = 28
integer_29 = 29
integer_30 = 30
integer_31 = 31
integer_32 = 32
integer_33 = 33
integer_34 = 34
integer_35 = 35
integer_36 = 36
-57
View File
@@ -1,57 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitColumn.json
# timestamp: 2020-11-24T16:33:24+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class RevitColumn(BaseModel):
family: Optional[Optional[str]] = None
topLevel: Optional[Level] = None
baseOffset: Optional[float] = None
topOffset: Optional[float] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
height: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-59
View File
@@ -1,59 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitDuct.json
# timestamp: 2020-11-24T16:33:25+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class RevitDuct(BaseModel):
family: Optional[Optional[str]] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
width: Optional[float] = None
height: Optional[float] = None
diameter: Optional[float] = None
length: Optional[float] = None
level: Optional[Level] = None
velocity: Optional[float] = None
system: Optional[Optional[str]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
@@ -1,78 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitExtrusionRoof.json
# timestamp: 2020-11-24T16:33:25+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class ICurve(BaseModel):
__root__: Optional[Dict[str, Any]]
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Interval(BaseModel):
start: Optional[Optional[float]] = None
end: Optional[Optional[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Line(BaseModel):
value: Optional[List[float]] = None
domain: Optional[Interval] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class RevitExtrusionRoof(BaseModel):
start: Optional[float] = None
end: Optional[float] = None
referenceLine: Optional[Line] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
holes: Optional[List[ICurve]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-57
View File
@@ -1,57 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitFloor.json
# timestamp: 2020-11-24T16:33:26+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class ICurve(BaseModel):
__root__: Optional[Dict[str, Any]]
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class RevitFloor(BaseModel):
parameters: Optional[Optional[Dict[str, Any]]] = None
holes: Optional[List[ICurve]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
@@ -1,58 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitFootprintRoof.json
# timestamp: 2020-11-24T16:33:27+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class ICurve(BaseModel):
__root__: Optional[Dict[str, Any]]
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class RevitFootprintRoof(BaseModel):
cutOffLevel: Optional[Level] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
holes: Optional[List[ICurve]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-55
View File
@@ -1,55 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitLevel.json
# timestamp: 2020-11-24T16:33:28+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class RevitLevel(BaseModel):
createView: Optional[bool] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-68
View File
@@ -1,68 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitRoom.json
# timestamp: 2020-11-24T16:33:28+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class ICurve(BaseModel):
__root__: Optional[Dict[str, Any]]
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Point(BaseModel):
value: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class RevitRoom(BaseModel):
basePoint: Optional[Point] = None
number: Optional[Optional[str]] = None
area: Optional[float] = None
volume: Optional[float] = None
holes: Optional[List[ICurve]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-53
View File
@@ -1,53 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitShaft.json
# timestamp: 2020-11-24T16:33:29+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class RevitShaft(BaseModel):
topLevel: Optional[Level] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-28
View File
@@ -1,28 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitTopography.json
# timestamp: 2020-11-24T16:33:30+00:00
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class RevitTopography(BaseModel):
baseGeometry: Optional[Mesh] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
-11
View File
@@ -1,11 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitUtils.json
# timestamp: 2020-11-24T16:33:30+00:00
from __future__ import annotations
from pydantic import BaseModel
class RevitUtils(BaseModel):
pass
@@ -1,64 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitVerticalOpening.json
# timestamp: 2020-11-24T16:33:31+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Element(BaseModel):
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class RevitVerticalOpening(BaseModel):
host: Optional[Element] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
-45
View File
@@ -1,45 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitWall.json
# timestamp: 2020-11-24T16:33:32+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class RevitWall(BaseModel):
topLevel: Optional[Level] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
Level.update_forward_refs()
@@ -1,58 +0,0 @@
# generated by datamodel-codegen:
# filename: RevitWallOpening.json
# timestamp: 2020-11-24T16:33:33+00:00
from __future__ import annotations
from typing import Any, Dict, List, Optional
from pydantic import BaseModel
class IGeometry(BaseModel):
__root__: Optional[Dict[str, Any]]
class Mesh(BaseModel):
vertices: Optional[List[float]] = None
faces: Optional[List[int]] = None
colors: Optional[List[int]] = None
textureCoordinates: Optional[List[float]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class Level(BaseModel):
name: Optional[Optional[str]] = None
elevation: Optional[float] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
class RevitWall(BaseModel):
topLevel: Optional[Level] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
class RevitWallOpening(BaseModel):
host: Optional[RevitWall] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
baseGeometry: Optional[IGeometry] = None
displayMesh: Optional[Mesh] = None
type: Optional[Optional[str]] = None
level: Optional[Level] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
Level.update_forward_refs()
@@ -1,22 +0,0 @@
# generated by datamodel-codegen:
# filename: RoomBoundaryLine.json
# timestamp: 2020-11-24T16:33:35+00:00
from __future__ import annotations
from typing import Any, Dict, Optional
from pydantic import BaseModel
class ICurve(BaseModel):
__root__: Optional[Dict[str, Any]]
class RoomBoundaryLine(BaseModel):
baseCurve: Optional[ICurve] = None
parameters: Optional[Optional[Dict[str, Any]]] = None
id: Optional[Optional[str]] = None
totalChildrenCount: Optional[int] = None
applicationId: Optional[Optional[str]] = None
speckle_type: Optional[Optional[str]] = None
+23
View File
@@ -0,0 +1,23 @@
"""This module contains an SDK for working with Speckle Automate."""
from speckle_automate.automation_context import AutomationContext
from speckle_automate.runner import execute_automate_function, run_function
from speckle_automate.schema import (
AutomateBase,
AutomationResult,
AutomationRunData,
AutomationStatus,
ObjectResult,
ObjectResultLevel,
)
__all__ = [
"AutomationContext",
"AutomateBase",
"AutomationStatus",
"AutomationResult",
"AutomationRunData",
"ObjectResult",
"ObjectResultLevel",
"run_function",
"execute_automate_function",
]
+278
View File
@@ -0,0 +1,278 @@
"""This module provides an abstraction layer above the Speckle Automate runtime."""
from dataclasses import dataclass, field
from pathlib import Path
import time
from typing import Optional, Union
import httpx
from gql import gql
from specklepy.api import operations
from specklepy.api.client import SpeckleClient
from specklepy.objects import Base
from specklepy.transports.memory import MemoryTransport
from specklepy.transports.server import ServerTransport
from speckle_automate.schema import (
AutomateBase,
AutomationResult,
AutomationRunData,
AutomationStatus,
ObjectResult,
ObjectResultLevel,
)
@dataclass
class AutomationContext:
"""A context helper class.
This class exposes methods to work with the Speckle Automate context inside
Speckle Automate functions.
An instance of AutomationContext is injected into every run of a function.
"""
automation_run_data: AutomationRunData
speckle_client: SpeckleClient
_server_transport: ServerTransport
_speckle_token: str
#: keep a memory transponrt at hand, to speed up things if needed
_memory_transport: MemoryTransport = field(default_factory=MemoryTransport)
#: added for performance measuring
_init_time: float = field(default_factory=time.perf_counter)
_automation_result: AutomationResult = field(default_factory=AutomationResult)
@classmethod
def initialize(
cls, automation_run_data: Union[str, AutomationRunData], speckle_token: str
) -> "AutomationContext":
"""Bootstrap the AutomateSDK from raw data.
Todo:
----
* bootstrap a structlog logger instance
* expose a logger, that ppl can use instead of print
"""
# parse the json value if its not an initialized project data instance
automation_run_data = (
automation_run_data
if isinstance(automation_run_data, AutomationRunData)
else AutomationRunData.model_validate_json(automation_run_data)
)
speckle_client = SpeckleClient(
automation_run_data.speckle_server_url,
automation_run_data.speckle_server_url.startswith("https"),
)
speckle_client.authenticate_with_token(speckle_token)
if not speckle_client.account:
msg = (
f"Could not autenticate to {automation_run_data.speckle_server_url}",
"with the provided token",
)
raise ValueError(msg)
server_transport = ServerTransport(
automation_run_data.project_id, speckle_client
)
return cls(automation_run_data, speckle_client, server_transport, speckle_token)
@property
def run_status(self) -> AutomationStatus:
"""Get the status of the automation run."""
return self._automation_result.run_status
def elapsed(self) -> float:
"""Return the elapsed time in seconds since the initialization time."""
return time.perf_counter() - self._init_time
def receive_version(self) -> Base:
"""Receive the Speckle project version that triggered this automation run."""
commit = self.speckle_client.commit.get(
self.automation_run_data.project_id, self.automation_run_data.version_id
)
if not commit.referencedObject:
raise ValueError("The commit has no referencedObject, cannot receive it.")
base = operations.receive(
commit.referencedObject, self._server_transport, self._memory_transport
)
print(
f"It took {self.elapsed():2f} seconds to receive",
f" the speckle version {self.automation_run_data.version_id}",
)
return base
def create_new_version_in_project(
self, root_object: Base, model_id: str, version_message: str = ""
) -> None:
"""Save a base model to a new version on the project.
Args:
root_object (Base): The Speckle base object for the new version.
model_id (str): For now please use a `branchName`!
version_message (str): The message for the new version.
"""
if model_id == self.automation_run_data.model_id:
raise ValueError(
f"The target model id: {model_id} cannot match the model id"
f" that triggered this automation: {self.automation_run_data.model_id}"
)
root_object_id = operations.send(
root_object,
[self._server_transport, self._memory_transport],
use_default_cache=False,
)
version_id = self.speckle_client.commit.create(
stream_id=self.automation_run_data.project_id,
object_id=root_object_id,
branch_name=model_id,
message=version_message,
source_application="SpeckleAutomate",
)
self._automation_result.result_versions.append(version_id)
def report_run_status(self) -> None:
"""Report the current run status to the project of this automation."""
query = gql(
"""
mutation ReportFunctionRunStatus(
$automationId: String!,
$automationRevisionId: String!,
$automationRunId: String!,
$versionId: String!,
$functionId: String!,
$runStatus: AutomationRunStatus!
$elapsed: Float!
$resultVersionIds: [String!]!
$statusMessage: String
$objectResults: JSONObject
){
automationMutations {
functionRunStatusReport(input: {
automationId: $automationId
automationRevisionId: $automationRevisionId
automationRunId: $automationRunId
versionId: $versionId
functionRuns: [
{
functionId: $functionId
status: $runStatus,
elapsed: $elapsed,
resultVersionIds: $resultVersionIds,
statusMessage: $statusMessage
results: $objectResults
}]
})
}
}
"""
)
if self.run_status in [AutomationStatus.SUCCEEDED, AutomationStatus.FAILED]:
object_results = {
"version": "1.0.0",
"values": {
"speckleObjects": self._automation_result.model_dump(by_alias=True)[
"objectResults"
],
"blobs": self._automation_result.blobs,
},
}
else:
object_results = None
params = {
"automationId": self.automation_run_data.automation_id,
"automationRevisionId": self.automation_run_data.automation_revision_id,
"automationRunId": self.automation_run_data.automation_run_id,
"versionId": self.automation_run_data.version_id,
"functionId": self.automation_run_data.function_id,
"runStatus": self.run_status.value,
"statusMessage": self._automation_result.status_message,
"elapsed": self.elapsed(),
"resultVersionIds": self._automation_result.result_versions,
"objectResults": object_results,
}
self.speckle_client.httpclient.execute(query, params)
def store_file_result(self, file_path: Union[Path, str]) -> None:
"""Save a file attached to the project of this automation."""
path_obj = (
Path(file_path).resolve() if isinstance(file_path, str) else file_path
)
class UploadResult(AutomateBase):
blob_id: str
file_name: str
upload_status: int
class BlobUploadResponse(AutomateBase):
upload_results: list[UploadResult]
if not path_obj.exists():
raise ValueError("The given file path doesn't exist")
files = {path_obj.name: open(str(path_obj), "rb")}
url = (
f"{self.automation_run_data.speckle_server_url}/api/stream/"
f"{self.automation_run_data.project_id}/blob"
)
data = (
httpx.post(
url,
files=files,
headers={"authorization": f"Bearer {self._speckle_token}"},
)
.raise_for_status()
.json()
)
upload_response = BlobUploadResponse.model_validate(data)
if len(upload_response.upload_results) != 1:
raise ValueError("Expecting one upload result.")
for upload_result in upload_response.upload_results:
self._automation_result.blobs.append(upload_result.blob_id)
def mark_run_failed(self, status_message: str) -> None:
"""Mark the current run a failure."""
self._mark_run(AutomationStatus.FAILED, status_message)
def mark_run_success(self, status_message: Optional[str]) -> None:
"""Mark the current run a success with an optional message."""
self._mark_run(AutomationStatus.SUCCEEDED, status_message)
def _mark_run(
self, status: AutomationStatus, status_message: Optional[str]
) -> None:
duration = self.elapsed()
self._automation_result.status_message = status_message
self._automation_result.run_status = status
self._automation_result.elapsed = duration
msg = f"Automation run {status.value} after {duration:2f} seconds."
print("\n".join([msg, status_message]) if status_message else msg)
def add_object_error(self, object_id: str, error_cause: str) -> None:
"""Add an error to a given Speckle object."""
self._add_object_result(object_id, ObjectResultLevel.ERROR, error_cause)
def add_object_warning(self, object_id: str, warning: str) -> None:
"""Add a warning to a given Speckle object."""
self._add_object_result(object_id, ObjectResultLevel.WARNING, warning)
def add_object_info(self, object_id: str, info: str) -> None:
"""Add an info message to a given Speckle object."""
self._add_object_result(object_id, ObjectResultLevel.INFO, info)
def _add_object_result(
self, object_id: str, level: ObjectResultLevel, status_message: str
) -> None:
print(
f"Object {object_id} was marked with {level.value.upper()}",
f" cause: {status_message}",
)
self._automation_result.object_results[object_id].append(
ObjectResult(level=level, status_message=status_message)
)
+155
View File
@@ -0,0 +1,155 @@
"""Function execution module.
Provides mechanisms to execute any function,
that conforms to the AutomateFunction "interface"
"""
import json
import os
import sys
import traceback
from pathlib import Path
from typing import Callable, Optional, TypeVar, Union, overload
from speckle_automate.automation_context import AutomationContext
from speckle_automate.schema import AutomateBase, AutomationRunData, AutomationStatus
T = TypeVar("T", bound=AutomateBase)
AutomateFunction = Callable[[AutomationContext, T], None]
AutomateFunctionWithoutInputs = Callable[[AutomationContext], None]
@overload
def execute_automate_function(
automate_function: AutomateFunction[T],
input_schema: type[T],
) -> None:
...
@overload
def execute_automate_function(automate_function: AutomateFunctionWithoutInputs) -> None:
...
def execute_automate_function(
automate_function: Union[AutomateFunction[T], AutomateFunctionWithoutInputs],
input_schema: Optional[type[T]] = None,
):
"""Runs the provided automate function with the input schema."""
# first arg is the python file name, we do not need that
args = sys.argv[1:]
if len(args) < 2:
raise ValueError("too few arguments specified need minimum 2")
if len(args) > 4:
raise ValueError("too many arguments specified, max supported is 4")
# we rely on a command name convention to decide what to do.
# this is here, so that the function authors do not see any of this
command = args[0]
if command == "generate_schema":
path = Path(args[1])
schema = json.dumps(
input_schema.model_json_schema(by_alias=True) if input_schema else {}
)
path.write_text(schema)
elif command == "run":
automation_run_data = args[1]
function_inputs = args[2]
speckle_token = os.environ.get("SPECKLE_TOKEN", None)
if not speckle_token and len(args) != 4:
raise ValueError("Cannot get speckle token from arguments or environment")
speckle_token = speckle_token if speckle_token else args[3]
inputs = (
input_schema.model_validate_json(function_inputs)
if input_schema
else input_schema
)
if inputs:
automation_context = run_function(
automate_function, # type: ignore
automation_run_data,
speckle_token,
inputs,
)
else:
automation_context = run_function(
automate_function, # type: ignore
automation_run_data,
speckle_token,
)
exit_code = (
0 if automation_context.run_status == AutomationStatus.SUCCEEDED else 1
)
exit(exit_code)
else:
raise NotImplementedError(f"Command: '{command}' is not supported.")
@overload
def run_function(
automate_function: AutomateFunction[T],
automation_run_data: Union[AutomationRunData, str],
speckle_token: str,
inputs: T,
) -> AutomationContext:
...
@overload
def run_function(
automate_function: AutomateFunctionWithoutInputs,
automation_run_data: Union[AutomationRunData, str],
speckle_token: str,
) -> AutomationContext:
...
def run_function(
automate_function: Union[AutomateFunction[T], AutomateFunctionWithoutInputs],
automation_run_data: Union[AutomationRunData, str],
speckle_token: str,
inputs: Optional[T] = None,
) -> AutomationContext:
"""Run the provided function with the automate sdk context."""
automation_context = AutomationContext.initialize(
automation_run_data, speckle_token
)
automation_context.report_run_status()
try:
# avoiding complex type gymnastics here on the internals.
# the external type overloads make this correct
if inputs:
automate_function(automation_context, inputs) # type: ignore
else:
automate_function(automation_context) # type: ignore
# the function author forgot to mark the function success
if automation_context.run_status not in [
AutomationStatus.FAILED,
AutomationStatus.SUCCEEDED,
]:
automation_context.mark_run_success(
"WARNING: Automate assumed a success status,"
" but it was not marked as so by the function."
)
except Exception:
trace = traceback.format_exc()
print(trace)
automation_context.mark_run_failed(
"Function error. Check the automation run logs for details."
)
finally:
automation_context.report_run_status()
return automation_context
+73
View File
@@ -0,0 +1,73 @@
""""""
from collections import defaultdict
from enum import Enum
from typing import Optional
from pydantic import BaseModel, ConfigDict, Field
from stringcase import camelcase
class AutomateBase(BaseModel):
"""Use this class as a base model for automate related DTO."""
model_config = ConfigDict(alias_generator=camelcase, populate_by_name=True)
class AutomationRunData(BaseModel):
"""Values of the project / model that triggered the run of this function."""
project_id: str
model_id: str
branch_name: str
version_id: str
speckle_server_url: str
automation_id: str
automation_revision_id: str
automation_run_id: str
function_id: str
function_revision: str
model_config = ConfigDict(
alias_generator=camelcase, populate_by_name=True, protected_namespaces=()
)
class AutomationStatus(str, Enum):
"""Set the status of the automation."""
INITIALIZING = "INITIALIZING"
RUNNING = "RUNNING"
FAILED = "FAILED"
SUCCEEDED = "SUCCEEDED"
class ObjectResultLevel(str, Enum):
"""Possible status message levels for object reports."""
INFO = "INFO"
WARNING = "WARNING"
ERROR = "ERROR"
class ObjectResult(AutomateBase):
"""An object level result."""
level: ObjectResultLevel
status_message: str
class AutomationResult(AutomateBase):
"""Schema accepted by the Speckle server as a result for an automation run."""
elapsed: float = 0
result_view: Optional[str] = None
result_versions: list[str] = Field(default_factory=list)
blobs: list[str] = Field(default_factory=list)
run_status: AutomationStatus = AutomationStatus.RUNNING
status_message: Optional[str] = None
object_results: dict[str, list[ObjectResult]] = Field(
default_factory=lambda: defaultdict(list) # typing: ignore
)
+159
View File
@@ -0,0 +1,159 @@
import re
from typing import Dict
from warnings import warn
from deprecated import deprecated
from gql import Client
from gql.transport.exceptions import TransportServerError
from gql.transport.requests import RequestsHTTPTransport
from gql.transport.websockets import WebsocketsTransport
from specklepy.api import resources
from specklepy.api.credentials import Account, get_account_from_token
from specklepy.api.resources import (
user,
active_user,
branch,
commit,
object,
other_user,
server,
stream,
subscriptions,
)
from specklepy.logging import metrics
from specklepy.logging.exceptions import SpeckleException, SpeckleWarning
from specklepy.core.api.client import SpeckleClient as CoreSpeckleClient
class SpeckleClient(CoreSpeckleClient):
"""
The `SpeckleClient` is your entry point for interacting with
your Speckle Server's GraphQL API.
You'll need to have access to a server to use it,
or you can use our public server `speckle.xyz`.
To authenticate the client, you'll need to have downloaded
the [Speckle Manager](https://speckle.guide/#speckle-manager)
and added your account.
```py
from specklepy.api.client import SpeckleClient
from specklepy.api.credentials import get_default_account
# initialise the client
client = SpeckleClient(host="speckle.xyz") # or whatever your host is
# client = SpeckleClient(host="localhost:3000", use_ssl=False) or use local server
# authenticate the client with an account (account has been added in Speckle Manager)
account = get_default_account()
client.authenticate_with_account(account)
# create a new stream. this returns the stream id
new_stream_id = client.stream.create(name="a shiny new stream")
# use that stream id to get the stream from the server
new_stream = client.stream.get(id=new_stream_id)
```
"""
DEFAULT_HOST = "speckle.xyz"
USE_SSL = True
def __init__(self, host: str = DEFAULT_HOST, use_ssl: bool = USE_SSL) -> None:
super().__init__(
host=host,
use_ssl=use_ssl,
)
self.account = Account()
def _init_resources(self) -> None:
self.server = server.Resource(
account=self.account, basepath=self.url, client=self.httpclient
)
server_version = None
try:
server_version = self.server.version()
except Exception:
pass
self.user = user.Resource(
account=self.account,
basepath=self.url,
client=self.httpclient,
server_version=server_version,
)
self.other_user = other_user.Resource(
account=self.account,
basepath=self.url,
client=self.httpclient,
server_version=server_version,
)
self.active_user = active_user.Resource(
account=self.account,
basepath=self.url,
client=self.httpclient,
server_version=server_version,
)
self.stream = stream.Resource(
account=self.account,
basepath=self.url,
client=self.httpclient,
server_version=server_version,
)
self.commit = commit.Resource(
account=self.account, basepath=self.url, client=self.httpclient
)
self.branch = branch.Resource(
account=self.account, basepath=self.url, client=self.httpclient
)
self.object = object.Resource(
account=self.account, basepath=self.url, client=self.httpclient
)
self.subscribe = subscriptions.Resource(
account=self.account,
basepath=self.ws_url,
client=self.wsclient,
)
@deprecated(
version="2.6.0",
reason=(
"Renamed: please use `authenticate_with_account` or"
" `authenticate_with_token` instead."
),
)
def authenticate(self, token: str) -> None:
"""Authenticate the client using a personal access token
The token is saved in the client object and a synchronous GraphQL
entrypoint is created
Arguments:
token {str} -- an api token
"""
metrics.track(metrics.SDK, self.account, {"name": "Client Authenticate_deprecated"})
return super().authenticate(token)
def authenticate_with_token(self, token: str) -> None:
"""
Authenticate the client using a personal access token.
The token is saved in the client object and a synchronous GraphQL
entrypoint is created
Arguments:
token {str} -- an api token
"""
metrics.track(metrics.SDK, self.account, {"name": "Client Authenticate With Token"})
return super().authenticate_with_token(token)
def authenticate_with_account(self, account: Account) -> None:
"""Authenticate the client using an Account object
The account is saved in the client object and a synchronous GraphQL
entrypoint is created
Arguments:
account {Account} -- the account object which can be found with
`get_default_account` or `get_local_accounts`
"""
metrics.track(metrics.SDK, self.account, {"name": "Client Authenticate With Account"})
return super().authenticate_with_account(account)
+77
View File
@@ -0,0 +1,77 @@
import os
from typing import List, Optional
from pydantic import BaseModel, Field # pylint: disable=no-name-in-module
from specklepy.api.models import ServerInfo
from specklepy.core.helpers import speckle_path_provider
from specklepy.logging import metrics
from specklepy.logging.exceptions import SpeckleException
from specklepy.transports.sqlite import SQLiteTransport
# following imports seem to be unnecessary, but they need to stay
# to not break the scripts using these functions as non-core
from specklepy.core.api.credentials import (Account, UserInfo,
StreamWrapper, # deprecated
get_local_accounts as core_get_local_accounts,
get_account_from_token as core_get_account_from_token)
def get_local_accounts(base_path: Optional[str] = None) -> List[Account]:
"""Gets all the accounts present in this environment
Arguments:
base_path {str} -- custom base path if you are not using the system default
Returns:
List[Account] -- list of all local accounts or an empty list if
no accounts were found
"""
accounts = core_get_local_accounts(base_path)
metrics.track(
metrics.SDK,
next(
(acc for acc in accounts if acc.isDefault),
accounts[0] if accounts else None,
),
{"name": "Get Local Accounts"}
)
return accounts
def get_default_account(base_path: Optional[str] = None) -> Optional[Account]:
"""
Gets this environment's default account if any. If there is no default,
the first found will be returned and set as default.
Arguments:
base_path {str} -- custom base path if you are not using the system default
Returns:
Account -- the default account or None if no local accounts were found
"""
accounts = core_get_local_accounts(base_path=base_path)
if not accounts:
return None
default = next((acc for acc in accounts if acc.isDefault), None)
if not default:
default = accounts[0]
default.isDefault = True
metrics.initialise_tracker(default)
return default
def get_account_from_token(token: str, server_url: str = None) -> Account:
"""Gets the local account for the token if it exists
Arguments:
token {str} -- the api token
Returns:
Account -- the local account with this token or a shell account containing
just the token and url if no local account is found
"""
account = core_get_account_from_token(token, server_url)
metrics.track( metrics.SDK, account, {"name": "Get Account From Token"} )
return account
+18
View File
@@ -0,0 +1,18 @@
from dataclasses import dataclass
from enum import Enum
from unicodedata import name
# following imports seem to be unnecessary, but they need to stay
# to not break the scripts using these functions as non-core
from specklepy.core.api.host_applications import (HostApplication, HostAppVersion,
get_host_app_from_string,
_app_name_host_app_mapping,
RHINO,GRASSHOPPER,REVIT,DYNAMO,UNITY,GSA,
CIVIL,AUTOCAD,MICROSTATION,OPENROADS,
OPENRAIL,OPENBUILDINGS,ETABS,SAP2000,CSIBRIDGE,
SAFE,TEKLASTRUCTURES,DXF,EXCEL,UNREAL,POWERBI,
BLENDER,QGIS,ARCGIS,SKETCHUP,ARCHICAD,TOPSOLID,
PYTHON,NET,OTHER)
if __name__ == "__main__":
print(HostAppVersion.v)
+12
View File
@@ -0,0 +1,12 @@
from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel, Field
# following imports seem to be unnecessary, but they need to stay
# to not break the scripts using these functions as non-core
from specklepy.core.api.models import (Collaborator, Commit,
Commits, Object, Branch, Branches,
Stream, Streams, User, LimitedUser,
PendingStreamCollaborator, Activity,
ActivityCollection, ServerInfo)
+100
View File
@@ -0,0 +1,100 @@
from typing import List, Optional
from specklepy.logging import metrics
from specklepy.logging.exceptions import SpeckleException
from specklepy.objects.base import Base
from specklepy.serialization.base_object_serializer import BaseObjectSerializer
from specklepy.transports.abstract_transport import AbstractTransport
from specklepy.transports.sqlite import SQLiteTransport
from specklepy.core.api.operations import (send as core_send,
receive as _untracked_receive,
serialize as core_serialize,
deserialize as core_deserialize)
def send(
base: Base,
transports: Optional[List[AbstractTransport]] = None,
use_default_cache: bool = True,
):
"""Sends an object via the provided transports. Defaults to the local cache.
Arguments:
obj {Base} -- the object you want to send
transports {list} -- where you want to send them
use_default_cache {bool} -- toggle for the default cache.
If set to false, it will only send to the provided transports
Returns:
str -- the object id of the sent object
"""
if transports is None:
metrics.track(metrics.SEND)
else:
metrics.track(metrics.SEND, getattr(transports[0], "account", None))
return core_send(base, transports, use_default_cache)
def receive(
obj_id: str,
remote_transport: Optional[AbstractTransport] = None,
local_transport: Optional[AbstractTransport] = None,
) -> Base:
"""Receives an object from a transport.
Arguments:
obj_id {str} -- the id of the object to receive
remote_transport {Transport} -- the transport to receive from
local_transport {Transport} -- the local cache to check for existing objects
(defaults to `SQLiteTransport`)
Returns:
Base -- the base object
"""
metrics.track(metrics.RECEIVE, getattr(remote_transport, "account", None))
return _untracked_receive(obj_id, remote_transport, local_transport)
def serialize(base: Base, write_transports: List[AbstractTransport] = []) -> str:
"""
Serialize a base object. If no write transports are provided,
the object will be serialized
without detaching or chunking any of the attributes.
Arguments:
base {Base} -- the object to serialize
write_transports {List[AbstractTransport]}
-- optional: the transports to write to
Returns:
str -- the serialized object
"""
metrics.track(metrics.SDK, custom_props={"name": "Serialize"})
return core_serialize(base, write_transports)
def deserialize(
obj_string: str, read_transport: Optional[AbstractTransport] = None
) -> Base:
"""
Deserialize a string object into a Base object.
If the object contains referenced child objects that are not stored in the local db,
a read transport needs to be provided in order to recompose
the base with the children objects.
Arguments:
obj_string {str} -- the string object to deserialize
read_transport {AbstractTransport}
-- the transport to fetch children objects from
(defaults to SQLiteTransport)
Returns:
Base -- the deserialized object
"""
metrics.track(metrics.SDK, custom_props={"name": "Deserialize"})
return core_deserialize(obj_string, read_transport)
__all__ = ["receive", "send", "serialize", "deserialize"]
+38
View File
@@ -0,0 +1,38 @@
from threading import Lock
from typing import Any, Dict, List, Optional, Tuple, Type, Union
from gql.client import Client
from gql.transport.exceptions import TransportQueryError
from graphql import DocumentNode
from specklepy.api.credentials import Account
from specklepy.logging.exceptions import (
GraphQLException,
SpeckleException,
UnsupportedException,
)
from specklepy.serialization.base_object_serializer import BaseObjectSerializer
from specklepy.transports.sqlite import SQLiteTransport
# following imports seem to be unnecessary, but they need to stay
# to not break the scripts using these functions as non-core
from specklepy.core.api.resource import ResourceBase as CoreResourceBase
class ResourceBase(CoreResourceBase):
def __init__(
self,
account: Account,
basepath: str,
client: Client,
name: str,
server_version: Optional[Tuple[Any, ...]] = None,
) -> None:
super().__init__(
account = account,
basepath = basepath,
client = client,
name = name,
server_version = server_version
)
@@ -1,13 +1,9 @@
from pathlib import Path
import sys
import inspect
import pkgutil
import sys
from importlib import import_module
for (_, name, _) in pkgutil.iter_modules([Path(__file__).parent]):
for _, name, _ in pkgutil.iter_modules(__path__):
imported_module = import_module("." + name, package=__name__)
if hasattr(imported_module, "Resource"):
setattr(sys.modules[__name__], name, imported_module)
setattr(sys.modules[__name__], name, imported_module)

Some files were not shown because too many files have changed in this diff Show More