A python implementation of urbit-ob
Project description
urbit-pob
A python implementation of urbit-ob
Install
Run pip install urbitob
Module Use
The library exposes two families of functions:
patp / patp_to_num / patp_to_hex / hex_to_patp / is_valid_patppatq / patq_to_num / patq_to_hex / hex_to_patq / is_valid_patq
As well as:
clan, for determining the ship class of a@pvaluesein, for determining the parent of a@pvalueeq_patq, for comparing@qvalues for equalityis_valid_pat, for a faster/weaker check of@por@q-ness that only validates syllables (and not proper dash formatting)
Example Usage
>>> import urbitob
>>> urbitob.patp(314159)
'~batdyr-topmun'
>>> urbitob.patp_to_num("~faster-pollen")
2077885931
>>> urbitob.hex_to_patq("EFFACED")
'~wisfes-batsed'
>>> urbitob.sein("~hashes-happen")
'~hattug'
>>> urbitob.clan("~marzod")
'star'
You could use it to generate list of Planets from a given Star:
>>> v = urbitob.patq_to_hex("~sordem")
>>> planets = list(urbitob.hex_to_patp(hex(i)[2:]+v) for i in range(1,0xffff))
>>> planets[:10]
['~rigteg-havtuc', '~lonnub-navhet', '~risheb-difryc', '~sigren-daldux', '~rammel-malmyl', '~rapmes-ralres', '~boswex-ravret', '~sapper-loclut', '~talmep-sibsug', '~dalbur-todser']
Testing
A simple python -m unittest will run the test suite.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
urbitob-0.0.4.tar.gz
(8.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file urbitob-0.0.4.tar.gz.
File metadata
- Download URL: urbitob-0.0.4.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1536e74077dc31d5c26d5fb93063736cb06d0f2cbb7a67a1a2140e3a2f03024
|
|
| MD5 |
52dd833454985e52bd24a511134344a4
|
|
| BLAKE2b-256 |
9badaaaad7363fa3cf9ea065d72ece269b6de7799dce25d5c1de63ca5fdb373a
|
File details
Details for the file urbitob-0.0.4-py3-none-any.whl.
File metadata
- Download URL: urbitob-0.0.4-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dd9fdaf0a4d5cc75ff4ce54686b88f6803ed1c43110efcfe9b19d641bb55587
|
|
| MD5 |
39436f02ac92fec6a26fced9b2e6cfc8
|
|
| BLAKE2b-256 |
5764fa8aacdca900715a7accc1073eb6ff3d488218e6f046ef57f7b67e8e2f44
|