Skip to main content

Python library to crawl user notes from sharkey instances

Latest Version on PyPI GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Python wrapper for the /users/notes endpoint of Sharkey (and probably also Misskey). You can use this to crawl the public posts of a user.

Installation

You can install the package via poetry (or another tool of your choosing):

poetry add sharkey-crawler

Usage

from sharkey_crawler import SharkeyServer

SharkeyServer('example.org').user_notes(
    user_id='xxxxxxxxxx',
    allow_partial=True, 
    with_channel_notes=True,
    with_renotes=False,
    with_replies=False,
    with_files=False,
    limit=10,
    since_id=None,
    since_date=None,
    until_id=None,
    until_date=None
)

Checkout the docstring for more usage information.

Testing

# All
./venv/bin/pytest -m ""

# Unit
./venv/bin/pytest -m "unit"

# Integration
./venv/bin/pytest -m "integration"

# Unit and Integration
./venv/bin/pytest -m "integration or unit"

Development

Installing flit

python3 -m venv venv
./venv/bin/python -m pip install --upgrade pip
./venv/bin/python -m pip install flit
./venv/bin/flit install --only-deps --deps develop

Installing new dependencies

Either add the dependency to the optional dependencies, or create a new dependency within the [project] namespace, e.g.:

[project]
...
dependencies = [
    "requests==2.32.3"
]

Then, install dependencies with flit:

./venv/bin/flit install --only-deps --deps develop
# or: ./venv/bin/flit install --only-deps --deps all

Future Development

You might be asking yourself why this project does not expose more endpoints. It could, and it likely will, but currently, the endpoints are not well documented and it takes a lot of effort to even add a single endpoint, which Sharkey has a lot of. Since Sharkey is not very old and the future is still unclear, I will not take the effort it takes to support more endpoints until I have a use case for it or I see great demand. If you want more endpoints, there are two recommended solutions for this:

  • open a discussion, so I and possibly other developers can see which endpoints are requested a lot of have an interesting use case
    • also, vote for endpoints you want to see added in the future
  • contribute the endpoints yourself

There might also be solutions to automate parts of the development like creating Pydantic classes. If you are interested in this, feel free to contribute or open a discussion to organize this.

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

The MIT License (MIT). Please see License File for more information.

Metadata

Release files for sharkey-crawler 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sharkey-crawler 0.1.0
File Size Uploaded Provenance Actions
sharkey_crawler-0.1.0.tar.gz 17.8 kB Without provenance Details for sharkey_crawler-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sharkey-crawler 0.1.0
File Interpreter ABI Platform Actions
sharkey_crawler-0.1.0-py3-none-any.whl Python 3 none any Details for sharkey_crawler-0.1.0-py3-none-any.whl

Total release size: 27.2 kB

Release files / sharkey_crawler-0.1.0.tar.gz

Download URL sharkey_crawler-0.1.0.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
608da36d1f68970299069706af54b061801adccba3d1d5f3f5530f132e9d1d62
BLAKE2b-256 checksum
How to use checksums
d2c542d86bc7945e242a8af003859a361ad159544c5f9f5dbff119da4430f0ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Release files / sharkey_crawler-0.1.0-py3-none-any.whl

Download URL sharkey_crawler-0.1.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
147de3e3a7983e25876b91deacad0573f9c63e207f6d4a4e6654c8fca7569e1d
BLAKE2b-256 checksum
How to use checksums
9043334591962936cc2fe8b22ea5fa0c30aabc6622f1d62d8139cdf56b884253
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.4

Security for sharkey-crawler 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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