Skip to main content

rnl This is a Python package that allows you to acquire your RecNet access token and more with your cookie! 🍪

Features

  • Automatically renewing token
  • Supports 2FA accounts
  • Decoding the bearer token
  • Detailed exceptions

Installation

Download the recnetlogin folder and place it in your project.

pip installation once this is stable.

Setup

Gathering your session token

  1. Login to RecNet. While logging in, make sure you toggle on "Remember me / my machine".
  2. Open your browser's DevTools (Inspect Element)
  3. Open the Storage or Application tab on the top
  4. Locate Cookies > https://rec.net on the directory
  5. Search for __Secure-next-auth.session-token by filtering the cookies
  6. Double click the value and copy it image

Option 1/2: Storing it in your environment variables (Windows)

  1. Search for environment variables and open the first result

image

  1. Click Environment Variables...

image

  1. Click New under System Variables

image

  1. Name the variable RN_COOKIE and paste the copied value

image

  1. Press OK on all the opened tabs

  2. Restart your computer for it to take effect

Option 2/2: Storing it in a .env.secret file

  1. Make a new file named .env.secret in your project's directory
  2. Type RN_SESSION_TOKEN= in the file and paste the copied value

image

  1. If the file is not in your project's directory, make sure to specify it
rnl = RecNetLogin(env_path=".env.secret")  # Env path defaults to local directory

Usage

Getting your token

from RecNetLogin import RecNetLogin

rnl = RecNetLogin()
token = rnl.get_token()
decoded_token = rnl.get_decoded_token()  # JWT decoded
print(token, decoded_token)

Making authorized calls

from recnetlogin import RecNetLogin

rnl = RecNetLogin(env_path=".env.secret")

# Fetch using RecNetLogin's HTTPX client
r = rnl.client.get("https://accounts.rec.net/account/me")

for key, value in r.json().items():
    print(key, value)

# Close the client once done
rnl.close()

Metadata

Release files for recnetlogin 0.2.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 recnetlogin 0.2.0
File Size Uploaded
recnetlogin-0.2.0.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for recnetlogin 0.2.0
File Interpreter ABI Platform
recnetlogin-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.9 kB

Release files / recnetlogin-0.2.0.tar.gz

Download URL recnetlogin-0.2.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
81bea257d9cc48aa22aaf6daa2d7d261fdafc8f7d748f4b4daf22dd677dfc1df
BLAKE2b-256 checksum
How to use checksums
23aada87ceb28e2b3acb588fd1a74abb5fae00a2850a22501452449bd8919403
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.0

Release files / recnetlogin-0.2.0-py3-none-any.whl

Download URL recnetlogin-0.2.0-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24776d9e5c0f041ed70238b1a3ce4cc5f6062e51f68f29c641f5c111b46a6f1f
BLAKE2b-256 checksum
How to use checksums
4398104f7b731df542809a1646868a67d7219605a60243a95f97eecd7def97de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.0

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release 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