Skip to main content

The Atsign Foundation

GitHub License PyPI version OpenSSF Scorecard OpenSSF Best Practices SLSA 3

The atPlatform for Python developers - (Beta Version)

This repo contains library, samples and examples for developers who wish to work with the atPlatform from Python code.

Getting Started

1. Installation

This package can be installed from PyPI with:

pip install atsdk

Alternatively clone this repo and from the repo root:

pip install -r requirements.txt
pip install .

2. Setting up your .atKeys

To run the examples save .atKeys file in the '~/.atsign/keys/' directory.

3. Sending and Receiving Data

There are 3 ways in which data can be sent and received from at server.

  1. Using PublicKey

    from at_client import AtClient
    from at_client.common import AtSign
    from at_client.common.keys import PublicKey
    
    atsign = AtSign("@bob")
    atclient = AtClient(atsign)
    pk = PublicKey("key", atsign)
    
    # Sending data
    response = atclient.put(pk, "value")
    print(response)
    
    # Receiving Data
    response = atclient.get(pk)
    print(response)
    
    # Deleting data
    response = atclient.delete(pk)
    print(response)
    
  2. Using SelfKey

    from at_client import AtClient
    from at_client.common import AtSign
    from at_client.common.keys import SelfKey
    
    atsign = AtSign("@bob")
    atclient = AtClient(atsign)
    sk = SelfKey("key", atsign)
    
    # Sending data
    response = atclient.put(sk, "value")
    print(response)
    
    # Receiving Data
    response = atclient.get(sk)
    print(response)
    
    # Deleting data
    response = atclient.delete(sk)
    print(response)
    
  3. Using SharedKey

    from at_client import AtClient
    from at_client.common import AtSign
    from at_client.common.keys import SharedKey
    
    bob = AtSign("@bob")
    alice = AtSign("@alice")
    bob_atclient = AtClient(bob)
    sk = SharedKey("key", bob, alice)
    
    # Sending data
    response = bob_atclient.put(sk, "value")
    print(response)
    
    # Receiving Data
    alice_atclient = AtClient(alice)
    response = alice_atclient.get(sk)
    print(response)
    
    # Deleting data
    response = bob_atclient.delete(sk)
    print(response)
    

CLI Tools

  • REPL - you can use this to type atPlatform commands and see responses; but the best thing about the REPL currently is that it shows the data notifications as they are received. The REPL code has the essentials of what a 'receiving' client needs to do - i.e.

    • create an AtClient (assigning a Queue object to its queue parameter)
    • start two new threads
      • one for the AtClient.start_monitor() task: receives data update/delete notification events (the event data contains the ciphertext)
      • the other one calls handle_event() method, which will read the upcoming events in the queue and handle them:
      • calling AtClient.handle_event() (to decrypt the notifications and introducing the result as a new event in the queue)
      • reading the new event, which contains the decrypted result
    • Instructions to run the REPL:
      1. Run repl.py and choose an atSign using option 1
      2. Select option 2. REPL will start and activate monitor mode automatically in a different thread. You can still send commands/verbs. You will start seeing your own notifications (from yourself to yourself) and heartbeat working (noop verb is sent from time to time as a keepalive)
      3. Use at_talk or any other tool to send notifications to your atSign from a different atSign. You should be able to see the complete notification, and the encrypted and decrypted value of it.
  • REGISTER - use this cli to register new free atsign. Uses onboarding cli to create atkey files.

    • Use following command to run the REGISTER cli using email:

      python register.py -e <email>
      
    • Use following command to run the REGISTER cli using api-key:

      python register.py -k <api-key>
      
  • ONBOARDING - use this cli to onboard a new atSign. Once onboarding is complete it creates the all-important keys file. Onboard is a subset of Register.

    • Use following command to run the ONBOARDING cli:

      python onboarding.py -a <atsign> -c <cram-secret>
      
  • SHARE - use this cli to share data between 2 atsigns.

    • Use following command to run the SHARE cli:

      python share.py -a <atsign> -o <other-atsign> -k <key-name> -s <value>
      
  • GET - use this cli to get shared data between 2 atsigns.

    • Use following command to run the GET cli:

      python get.py -a <atsign> -o <other-atsign> -k <key-name>
      
  • DELETE - use this cli to delete any key shared between 2 atsigns.

    • Use following command to run the DELETE cli:

      python delete.py -a <atsign> -o <other-atsign> -k <key-name>
      

Open source usage and contributions

This is open source code, so feel free to use it as is, suggest changes or enhancements or create your own version. See CONTRIBUTING.md for detailed guidance on how to setup tools, tests and make a pull request.

Maintainers

This project was created by Umang Shah and is maintained by Chris Swan and Xavier Lin

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atsdk-0.2.71.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

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

atsdk-0.2.71-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

Details for the file atsdk-0.2.71.tar.gz.

File metadata

  • Download URL: atsdk-0.2.71.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for atsdk-0.2.71.tar.gz
Algorithm Hash digest
SHA256 2438ac768d6919653cef3d824f6185808613f8750d9d23c4ef5b5f70f379ff02
MD5 2e2cfcbc68af9309a2569123cf32ee5f
BLAKE2b-256 b2011950c21671b703b26189223f6d76dc91ab8749f616b78b91762cebf9eaa4

See more details on using hashes here.

Provenance

The following attestation bundles were made for atsdk-0.2.71.tar.gz:

Publisher: build-publish.yml on atsign-foundation/at_python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file atsdk-0.2.71-py3-none-any.whl.

File metadata

  • Download URL: atsdk-0.2.71-py3-none-any.whl
  • Upload date:
  • Size: 34.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for atsdk-0.2.71-py3-none-any.whl
Algorithm Hash digest
SHA256 567a9eb071d6175644cc9c1e2fcaf0130d77f4c069abb35d043c87460c44b5b3
MD5 c64e65b8b0ddf6b851b5d749e45b1108
BLAKE2b-256 2e590854f1e83f35afada1db5d046243c991be6376a96b9c0ed8b1223f3ea641

See more details on using hashes here.

Provenance

The following attestation bundles were made for atsdk-0.2.71-py3-none-any.whl:

Publisher: build-publish.yml on atsign-foundation/at_python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.77

2 files

0.2.74

2 files

0.2.73

2 files

0.2.72

2 files

This release

0.2.71 This release

2 files

0.2.70

2 files

0.2.69

2 files

0.2.68

2 files

0.2.63

2 files

0.2.62

2 files

0.2.59

2 files

0.2.58

2 files

0.2.57

2 files

0.2.54

2 files

0.2.52

2 files

0.2.51

2 files

0.2.50

2 files

0.2.48

2 files

0.2.47

2 files

0.2.46

2 files

0.2.44

2 files

0.2.41

2 files

0.2.40

2 files

0.2.39

2 files

0.2.36

2 files

0.2.35

2 files

0.2.33

2 files

0.2.32

2 files

0.2.30

2 files

0.2.28

2 files

0.2.24

2 files

0.2.23

2 files

0.2.19

2 files

0.2.16

2 files

0.2.14

2 files

0.2.13

2 files

0.2.12

2 files

0.2.11

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page