customrp-core
A small Python library for setting a custom Discord Rich Presence, and the engine behind customrp-cli. It follows the rules of CustomRP, the Windows app by maximmax42, but has no GUI and no Windows-only parts.
Independent project. customrp-core is not part of CustomRP and is not maintained by its developer. Report problems here, not on the CustomRP repository.
What it does
- Talks to the Discord desktop client over its local IPC socket (Linux, macOS) or named pipe (Windows). No extra libraries are needed.
- Models everything CustomRP can set: activity type, name, details and state (with links), party size, five timestamp modes, large and small images (asset keys or URLs) with tooltips and links, two buttons, and which field shows in the member list.
- Validates a presence the way Discord will. It checks length limits (in characters or UTF-8 bytes), single-character fields, bad URLs, and image URLs Discord would truncate, so you get a readable error instead of a rejection.
- Cleans up the input the same way CustomRP does: it adds
https://, converts hosts to punycode, percent-encodes characters URLs can't contain, keeps a leading no-break space, and routes images from Discord's own CDN through CustomRP's proxy. - Keeps a presence up with
PresenceSession. It retries every 10 seconds when Discord isn't running, reconnects when Discord restarts, refreshes the local time display at midnight, and resends when the presence changes. - Reads and writes
.crppresets that open in the Windows app and the other way round. - Lists an application's art assets, using the public endpoint CustomRP uses.
- Ships a fake Discord server (
customrp_core.testing) for testing your own code without Discord.
It has no dependencies outside the Python standard library.
Install
Python 3.9 or newer. Install from PyPI, ideally inside a virtual environment:
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install customrp-core
Or straight from Git, at a release tag:
pip install "customrp-core @ git+https://github.com/KeiraOMG0/customrp-core.git@v0.1.2"
In a requirements.txt, either works:
customrp-core>=0.1.2,<0.2
customrp-core @ git+https://github.com/KeiraOMG0/customrp-core.git@v0.1.2
Example
import logging
from customrp_core import Button, Presence, PresenceSession, validate
logging.basicConfig(level=logging.INFO)
presence = Presence(
application_id="", # empty: CustomRP's default application
details="Writing a library",
state="in Python",
large_image="https://example.com/logo.png",
button1=Button("Source", "github.com/KeiraOMG0/customrp-core"),
)
for issue in validate(presence):
print(issue) # e.g. "details: must be at least 2 characters long ..."
session = PresenceSession(presence) # retries 30 times, every 10 s, like CustomRP
try:
session.run() # blocks; Ctrl+C to stop
except KeyboardInterrupt:
pass
More in docs/getting-started.md.
Documentation
| Page | Contents |
|---|---|
| Getting started | Installing, a first presence, common tasks |
| Presence model | Every field, its limits, validation, and how the payload is built |
| Sessions | PresenceSession: connecting, retries, updates, threads |
| Low-level IPC | DiscordIPC, where Discord's socket is looked for, the wire protocol |
| Presets | The .crp format and how it maps to Presence |
| Assets | Listing an application's uploaded images |
| Testing with FakeDiscord | Testing code that uses this library |
| Compatibility with CustomRP | What matches the Windows app, what differs, what isn't verified |
| Development | Running the tests, project layout, releasing |
Platform support
| Platform | Status |
|---|---|
| Windows 10/11 | Unit tests pass. A handshake with a real Discord client over its named pipe works. |
| Linux | Unit tests run in CI on Ubuntu, including a fake Discord over a real Unix socket. Not yet tried against a real Discord client. |
| macOS | Unit tests run in CI, as on Linux. Not yet tried against a real Discord client. |
The Discord client has to run on the same machine and user account, since Rich Presence only works through its local IPC endpoint. Flatpak, Snap and Vesktop socket locations are searched too (see docs/ipc.md); those paths come from other Rich Presence projects, and none has been tested here.
Credits
The presence rules, preset format and default application come from CustomRP by maximmax42 (MIT license). Thanks to them for the original app and for being open to an independent alternative.
License
MIT. See LICENSE.
Metadata
Release files for customrp-core 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| customrp_core-0.1.2.tar.gz | 30.8 kB | With provenance | Details for customrp_core-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| customrp_core-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for customrp_core-0.1.2-py3-none-any.whl |
Total release size: 55.5 kB
Release files / customrp_core-0.1.2.tar.gz
| Download URL | customrp_core-0.1.2.tar.gz |
|---|---|
| Size | 30.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
154c8542293e5e6745cc3a0e482a9583ae040e8cf5eb5e9c347a60fa77623f9e
|
|
BLAKE2b-256 checksum How to use checksums |
e64e1ac983f3fcd4f0ca15e337982a89447aae41dc306de20879380eaafcf27f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logRelease files / customrp_core-0.1.2-py3-none-any.whl
| Download URL | customrp_core-0.1.2-py3-none-any.whl |
|---|---|
| Size | 24.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
508e739d3817e8e30e133ba29f26ec384447192ffd56de9ed82ab4dee78388b9
|
|
BLAKE2b-256 checksum How to use checksums |
df884df4f081d4a1af383e686aed0f0128616f00dfc8a6748f0e1d32e4b21593
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logSecurity for customrp-core 0.1.2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for customrp_core-0.1.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logA 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.