Metadata-Version: 2.1
Name: psychonaut
Version: 0.0.9
Summary: Python async client and TUI for bsky
Home-page: https://github.com/jbn/psychonaut
License: MIT
Author: generativist
Author-email: jbn@abreka.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: aiodns (>=3.0.0,<4.0.0)
Requires-Dist: aiohttp (>=3.8.4,<4.0.0)
Requires-Dist: cbor2 (>=5.4.6,<6.0.0)
Requires-Dist: click (>=8.1.3,<9.0.0)
Requires-Dist: more-itertools (>=9.1.0,<10.0.0)
Requires-Dist: multiformats (>=0.2.1,<0.3.0)
Requires-Dist: pydantic (>=1.10.7,<2.0.0)
Requires-Dist: python-dateutil (>=2.8.2,<3.0.0)
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
Requires-Dist: websockets (>=11.0.2,<12.0.0)
Project-URL: Documentation, https://github.com/jbn/psychonaut
Project-URL: Repository, https://github.com/jbn/psychonaut
Description-Content-Type: text/markdown

![Tests](https://github.com/jbn/psychonaut/actions/workflows/test.yaml/badge.svg)


![Psychonaut helmet](./psychonaut_logo.png "A helmet for the psychonaut")


# PROGRESS REPORT

- [x] Parse the Lexicons with PyDantic
- [ ] Generate code from the Lexicons
    - [x] Generate files
    - [ ] Generate Fields from full Lexicon spec
        - [x] Generate code for queries
        - [ ] Generate code for records
        - [ ] Generate code for the procedures
    - [ ] Generate f: (Session, Req) -> Resp helper functions

# What is this?

An async python client for Bluesky.

I used to do a pretty absurd amount of experiments with twitter's api. But musk
has decided to turn that platform into a pay-for-play version of LinkedIn
and banished all the tinkerers. So, now I'm here.

# Should I use this?

Almost certainly not. Right now it's a bucket of slop. I offer no 
guarantees about the stability of the API, the correctness of the
implementation, or the quality of the documentation. 

If you want to use it, go ahead,

```bash
# In your venv or mamba env or whatever
pip install psychonaut
```

to use it as a library. This also installs the `psychonaut` command line tool.

```bash
psychonaut --help

# Temporary login
export BSKY_USERNAME=yourusername
export BSKY_PASSWORD=yourpassword

# Permanent login (~/.psychonaut.json)
psychonaut save-login yourusername 

psychonaut poast "hey look, an annoying cron job"
```

But definitely be mindful of the version because I'm going to break your code.

Alternatively, just use [pipx](https://pypa.github.io/pipx/)

```bash
pipx install psychonaut

export BSKY_USERNAME=yourusername
export BSKY_PASSWORD=yourpassword

psychonaut poast "hell yea, pipx"
```

### Firehose

**EXTREMELY EXPERIMENTAL AND STILL NOT FINISHED**

`repos-firehose-stream` saves the raw messages for subsequent replay so you
can at least collect now and i'll get the json emit / validation working
later.

```bash
# Stream the firehose
psychonaut repos-firehose-stream stream_dir

# Stream the firehose but print to stdout too
psychonaut repos-firehose-stream --tee stream_dir

# Replay serialized
psychonaut repos-firehose-replay stream_dir

# Replay serialized file
psychonaut repos-firehose-replay stream_dir/your_stream.b64-lines
```

# How is this made?

This is a collaboration between the [atproto repo](https://github.com/bluesky-social/atproto),
me, and my friend ChatGPT (using GPT-4). I've been toying around with this 
automatic `langa`<->`langb` transpiler in [langchain](https://github.com/hwchase17/langchain).
My original goal was to jointly build that while making my python client from the `atproto`
repo. However, the fine folks at OpenAI have decided to *still* not grant me access to 
GPT-4 in the API, and GPT-3 isn't quite good enough to do the job. So instead, 
this was me testing the fences "manually" (with ChatGPT.)

This also means this project is a bit...like theft? IDK. 

Question of the generative hour: where is the boundary?

# See Also (for pythonistas)

- [lexrpc](https://github.com/snarfed/lexrpc) (almost certainly better designed then mine)
- [atprotools](https://github.com/jbn/psychonaut/) *unstable*
