synfire 0.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- synfire/__init__.py +84 -0
- synfire/__main__.py +13 -0
- synfire/_version.py +7 -0
- synfire/api.py +806 -0
- synfire/auth.py +299 -0
- synfire/cli.py +146 -0
- synfire/client.py +889 -0
- synfire/commands/.gitkeep +1 -0
- synfire/commands/__init__.py +20 -0
- synfire/commands/info.py +186 -0
- synfire/commands/login.py +218 -0
- synfire/commands/logout.py +66 -0
- synfire/commands/pull.py +427 -0
- synfire/commands/push.py +430 -0
- synfire/commands/search.py +276 -0
- synfire/commands/verify.py +274 -0
- synfire/commands/whoami.py +161 -0
- synfire/config.py +405 -0
- synfire/constants.py +132 -0
- synfire/download.py +417 -0
- synfire/exceptions.py +438 -0
- synfire/exit_codes.py +71 -0
- synfire/models/__init__.py +47 -0
- synfire/models/base.py +170 -0
- synfire/models/organization.py +77 -0
- synfire/models/release.py +404 -0
- synfire/models/repository.py +97 -0
- synfire/models/user.py +60 -0
- synfire/output/__init__.py +57 -0
- synfire/output/console.py +110 -0
- synfire/output/errors.py +193 -0
- synfire/output/progress.py +345 -0
- synfire/output/styles.py +94 -0
- synfire/output/table.py +299 -0
- synfire/py.typed +1 -0
- synfire/upload.py +594 -0
- synfire-0.0.1.dist-info/METADATA +521 -0
- synfire-0.0.1.dist-info/RECORD +41 -0
- synfire-0.0.1.dist-info/WHEEL +4 -0
- synfire-0.0.1.dist-info/entry_points.txt +2 -0
- synfire-0.0.1.dist-info/licenses/LICENSE +5 -0
synfire/__init__.py
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Synfire SDK - Python client for the Synfire NIR Model Registry.
|
|
3
|
+
|
|
4
|
+
Synfire is a public registry for hosting and sharing neuromorphic models
|
|
5
|
+
in the Neuromorphic Intermediate Representation (NIR) format. This SDK
|
|
6
|
+
provides programmatic access to search, download, and publish models.
|
|
7
|
+
|
|
8
|
+
Quick Start:
|
|
9
|
+
from synfire import Client
|
|
10
|
+
|
|
11
|
+
# Create a client (uses stored credentials from 'synfire login')
|
|
12
|
+
client = Client()
|
|
13
|
+
|
|
14
|
+
# Search for models targeting T1 hardware
|
|
15
|
+
results = client.search("gesture", platforms=["T1"])
|
|
16
|
+
|
|
17
|
+
# Download a model
|
|
18
|
+
release = client.pull("nrg-lab/gesture-recognition", version="1.0.0")
|
|
19
|
+
|
|
20
|
+
# Load the NIR graph (requires: pip install synfire[nir])
|
|
21
|
+
graph = release.load()
|
|
22
|
+
|
|
23
|
+
Authentication:
|
|
24
|
+
The SDK resolves credentials in this order:
|
|
25
|
+
1. Token passed to Client(token="...")
|
|
26
|
+
2. SYNFIRE_TOKEN environment variable
|
|
27
|
+
3. Stored credentials from 'synfire login' (OS keyring)
|
|
28
|
+
|
|
29
|
+
For CI/CD pipelines, use the environment variable:
|
|
30
|
+
export SYNFIRE_TOKEN="synfire_your_token_here"
|
|
31
|
+
|
|
32
|
+
For more information:
|
|
33
|
+
- Documentation: https://docs.synfire.dev/sdk
|
|
34
|
+
- CLI Reference: https://docs.synfire.dev/cli
|
|
35
|
+
- Web Interface: https://synfire.dev
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
from synfire._version import __version__
|
|
39
|
+
from synfire.client import Client
|
|
40
|
+
from synfire.auth import CredentialStore
|
|
41
|
+
from synfire.constants import HardwareTarget
|
|
42
|
+
from synfire.exceptions import (
|
|
43
|
+
SynfireError,
|
|
44
|
+
AuthenticationError,
|
|
45
|
+
ValidationError,
|
|
46
|
+
NotFoundError,
|
|
47
|
+
ConflictError,
|
|
48
|
+
TombstonedError,
|
|
49
|
+
NetworkError,
|
|
50
|
+
ChecksumMismatchError,
|
|
51
|
+
)
|
|
52
|
+
from synfire.models import (
|
|
53
|
+
Release,
|
|
54
|
+
Repository,
|
|
55
|
+
Organization,
|
|
56
|
+
FileInfo,
|
|
57
|
+
User,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
__all__ = [
|
|
61
|
+
# Version
|
|
62
|
+
"__version__",
|
|
63
|
+
# Main client
|
|
64
|
+
"Client",
|
|
65
|
+
# Credential management
|
|
66
|
+
"CredentialStore",
|
|
67
|
+
# Enums
|
|
68
|
+
"HardwareTarget",
|
|
69
|
+
# Models
|
|
70
|
+
"Release",
|
|
71
|
+
"Repository",
|
|
72
|
+
"Organization",
|
|
73
|
+
"FileInfo",
|
|
74
|
+
"User",
|
|
75
|
+
# Exceptions
|
|
76
|
+
"SynfireError",
|
|
77
|
+
"AuthenticationError",
|
|
78
|
+
"ValidationError",
|
|
79
|
+
"NotFoundError",
|
|
80
|
+
"ConflictError",
|
|
81
|
+
"TombstonedError",
|
|
82
|
+
"NetworkError",
|
|
83
|
+
"ChecksumMismatchError",
|
|
84
|
+
]
|
synfire/__main__.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Allow running the CLI as: python -m synfire
|
|
3
|
+
|
|
4
|
+
This module serves as the entry point when the package is executed
|
|
5
|
+
as a module, enabling usage like:
|
|
6
|
+
python -m synfire login
|
|
7
|
+
python -m synfire search gesture
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from synfire.cli import app
|
|
11
|
+
|
|
12
|
+
if __name__ == "__main__":
|
|
13
|
+
app()
|