Skip to main content

Python library for interacting with the Solar System

Project description

Elements

Elements is a Python library for interacting with Solar, a framework for building cross-compatible social media platforms.

Visit https://credenso.cafe/info/ to learn more about the SOLAR system.

Elements is in active development.

Installation

Elements can be installed from PyPI under the name solar-elements: pip install solar-elements Alternatively, it can be cloned to the system and installed locally: pip install -e path/to/cloned_repo

Usage

Installing this library provides access to the 'elements' of online presence.

Here is some of what's possible:

Storage

By default, Solar stores all data in plaintext JSON format. It is stored in a folder indicated by the Solar config file (...) or 'data/' by default.

from elements.core import Element
e = Element(content="Hello!")
path = e.save()
print(path)
> 'data/elements/01432c93.json'
e2 = Element.load('elements/01432c93')
assert e.id == e2.id

Encryption

Solar implements Nostr-standard encryption (according to NIP-44)

from elements.core.encryption import encrypt, decrypt, nonce
key = nonce()
safu = encrypt('hello', key)
greeting = decrypt(safu, key)
print(greeting)
> 'hello'

Accounts

One of the most important features of Solar is its account system. Each Solar account is identified by a 32-byte private key. This key can be used as a BIP32 master key in order to derive an arbitrary number of other keys, each of which can be used to integrate with other protocols.

To put it simply, a Solar account can be used to derive Bitcoin wallets, SSH keys, Nostr identities and much more.

from elements.accounts import Member
from elements.sessions import Session
account = Member.register('npc', password='1234')
account.save()
s = Session(account, '1234') 
nostr = s.integration('nostr')
print(nostr.nsec)
> nsec1abc123...
print(nostr.npub)
> npub1abc123...

Check the src/elements/accounts/integrations/ folder to learn more about the integrations available.

Development

This package is maintained using poetry.

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

solar_elements-0.1.5.tar.gz (214.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solar_elements-0.1.5-py3-none-any.whl (260.5 kB view details)

Uploaded Python 3

File details

Details for the file solar_elements-0.1.5.tar.gz.

File metadata

  • Download URL: solar_elements-0.1.5.tar.gz
  • Upload date:
  • Size: 214.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.11.2 Linux/6.1.0-23-rt-amd64

File hashes

Hashes for solar_elements-0.1.5.tar.gz
Algorithm Hash digest
SHA256 072cfd02185fc01d99adb71ac2ff7efbc3a9076e459453ceba95bd7002b70f4e
MD5 fa863f9faebcb934e94428e374a06357
BLAKE2b-256 31c21576deecee72aea9ea678af74bd3a1518fa21a103ed5be3b8de767d4900e

See more details on using hashes here.

File details

Details for the file solar_elements-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: solar_elements-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 260.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.11.2 Linux/6.1.0-23-rt-amd64

File hashes

Hashes for solar_elements-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 40e438c2c0485cefca24832bc5698d68a94f24c9a8d5927d6fb35600e384569c
MD5 8a87e655c867ed6b7dcfe6dbfcfef12a
BLAKE2b-256 80e237739cec6904909d4713a9d32f7353d521a3c1cdf0ce59c2d3f03341d266

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page