Simple Wappsto Python user-interface to Wappsto Rest
Project description
python-wappsto-rest
Usecase Examples:
import uuid
from wappstorest import WappstoRest
from wappstorest import WappstoService
service = WappstoRest()
service.login(
username='the_user',
password='SuperSecurePasswordThatYouDoNotRemember'
)
the_network = service(WappstoService.NETWORK).service_id(
uuid.uuid4()
).get()
print(the_network.name)
print(the_network.meta.id)
service.logout()
from wappstorest import WappstoRest
from wappstorest import WappstoService
from wappstorest import WappstoPath
from wappstorest import WappstoSchema
service = WappstoRest()
service.login(
username='the_user',
password='SuperSecurePasswordThatYouDoNotRemember'
)
# Is this even possible?
device_list: WappstoSchema.response.IdList = service(
WappstoService.DEVICE
).filter(
WappstoPath.Device.meta.parent.name == "Production"
).get()
the_device: WappstoSchema.response.Device = service(
WappstoService.DEVICE
).service_id(device_list.id[0]).post(
WappstoSchema.create.Device(
name='button'
)
)
service.logout()
import datetime
from wappstorest import WappstoRest
from wappstorest import WappstoService
from wappstorest import WappstoPath
from wappstorest import WappstoSchema
service = WappstoRest()
service.login(
username='the_user',
password='SuperSecurePasswordThatYouDoNotRemember',
admin=True,
)
user_list: list[WappstoSchema.response.User] = service(
WappstoService.USER
).filter(
WappstoPath.User.meta.created < datetime.datetime.now()
).filter(
"this.user.name~=test_"
).option(
fullsearch=True,
).admin().get(expand=3)
service.logout()
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Notes:
- update schema -> patch
- create schema -> post
- output schema -> response on anything.
- query schema -> Options
Known Bugs
...
TODO List
Schema
- Fix
constr
,conint
... to Field: Pydantic Schema. - There need to be a Create Schema & response schema (output).
Code base
- Add more/better logging logs.
- Push to pip.
Tests
- Add more test to get a 100%-ish testing coverage.
v0.0.1 (Febuary 21, 2023)
Added
- First Release.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wappstorest-0.0.1.tar.gz
(113.7 kB
view hashes)
Built Distribution
wappstorest-0.0.1-py3-none-any.whl
(413.0 kB
view hashes)
Close
Hashes for wappstorest-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e124a946e763e78857bb5f7e9f573a035ae99ad70fbd4d85ebcd78b6e1f862a |
|
MD5 | e93d5490f36fee6f4c58c1517459f573 |
|
BLAKE2b-256 | c42636a9785fb13366a13e482a51cece150289464192534113da759e14a419be |