Skip to main content

NepTLS

Clear, inspectable HTTP and TLS tooling for Python.
A dependency-light client for protocol research, browser-compatible headers, diagnostics, and authorized automation.

PyPI version Python versions CI status MIT license Live docs

Read the docs · Install from PyPI · Open an issue

Why NepTLS?

NepTLS is built for engineers who need to see what happened on the wire instead of guessing. The default client stays portable and auditable with Python's standard library, while optional native transports make HTTP/2 and HTTP/3 available when your platform and dependencies support them.

import neptls

response = neptls.get(
    "https://example.com",
    impersonate="chrome",
    timeout=10,
)

response.raise_for_status()
print(response.status_code, response.http_version)

Highlights

Area What is included
HTTP get, post, put, patch, delete, head, options, JSON, forms, multipart, streaming
Client state Reusable clients, cookies, redirects, retries, compression, auth hooks, proxies
Async AsyncClient with the same request model and response conveniences
Browser compatibility Curated Chrome, Firefox, Edge, Safari, desktop, and mobile profiles
TLS Explicit TLSConfig, ALPN, certificate verification, TLS probing, JA3-compatible fields
Transports Dependency-free HTTP/1.1 plus explicit optional HTTP/2 and HTTP/3 adapters
Diagnostics DNS, TCP, TLS, HTTP, transport availability, timing, and failure context
Utilities User-agent parsing, URL/cookie helpers, hashing, encoding, pools, and generic PoW
CLI Requests, profiles, user agents, diagnostics, hashing, PoW, and version inspection

Install

Core NepTLS has zero runtime dependencies and supports Python 3.10–3.14.

python -m pip install --upgrade neptls

Optional native transports:

# HTTP/2 through httpx + hyper-h2
python -m pip install "neptls[http2]"

# HTTP/3 through curl-cffi + platform QUIC support
python -m pip install "neptls[http3]"

# Both optional transports
python -m pip install "neptls[native]"

Quick examples

Requests and reusable clients

import neptls

client = neptls.Client(
    profile="chrome-windows",
    retries=2,
    timeout=20,
    headers={"X-Research-Client": "neptls"},
)

response = client.get("https://httpbin.org/headers")
print(response.status_code)
print(response.json())

JSON, auth, and multipart

from neptls import BasicAuth, BearerAuth

client.post(
    "https://httpbin.org/post",
    json={"ready": True},
    auth=BearerAuth("token"),
)

client.get(
    "https://httpbin.org/basic-auth/user/pass",
    auth=BasicAuth("user", "pass"),
)

client.post(
    "https://example.com/upload",
    form={"description": "research report"},
    files={"document": ("report.txt", b"hello", "text/plain")},
)

Async requests

import asyncio
from neptls import AsyncClient

async def main():
    async with AsyncClient(impersonate="chrome", timeout=10) as client:
        response = await client.get("https://example.com")
        response.raise_for_status()
        print(response.status_code, response.text[:80])

asyncio.run(main())

Streaming

with neptls.get("https://example.com/large-file", stream=True) as response:
    for chunk in response.iter_bytes(64 * 1024):
        process(chunk)

Explicit HTTP/2 or HTTP/3

from neptls import Client, transport_available

transport = "http2" if transport_available("http2") else "http1"
client = Client(transport=transport)
response = client.get("https://example.com")

print(response.http_version)
print(response.timing.total)

NepTLS does not silently downgrade a requested native transport. If a selected backend is unavailable, it raises TransportUnavailableError unless you explicitly opt into fallback behavior.

TLS configuration and inspection

from neptls import TLSConfig, TLSFingerprint, probe_tls

config = TLSConfig(
    minimum_version="TLSv1.2",
    alpn_protocols=("h2", "http/1.1"),
    verify=True,
)

local = TLSFingerprint.from_config(config)
negotiated = probe_tls("example.com")

print(local.digest, local.ja3_hash)
print(negotiated.version, negotiated.cipher, negotiated.alpn)

Client.fingerprint() describes configured local state. probe_tls() performs a real verified handshake. Neither claims byte-identical browser ClientHello generation.

User agents and profiles

import neptls

print(neptls.ua.chrome())
print(neptls.ua.mobile())
print(neptls.profiles.get_profile("chrome-windows").to_json())
print(neptls.user_agents.parse(neptls.ua.random()))

The built-in user-agent catalog is intentionally curated. Load a properly licensed dataset into UserAgentDatabase when your application needs more entries; NepTLS does not bundle a copied third-party mega-list.

Diagnostics, hashing, and generic PoW

import neptls
from neptls.crypto import sha256
from neptls.pow import Challenge, solve_parallel

report = neptls.inspect("https://example.com")
print(report["tls"]["version"])
print(sha256("protocol message"))

challenge = Challenge("demo", difficulty=3, algorithm="sha256")
print(solve_parallel(challenge, workers=2))

The PoW helpers are generic protocol-research primitives. They are not tied to CAPTCHA solving, anti-abuse evasion, or access-control bypass.

CLI

neptls version
neptls get https://example.com
neptls get https://example.com --header "Accept: application/json"
neptls inspect https://example.com
neptls profile chrome-windows
neptls ua mobile
neptls hash "protocol message" --algorithm sha256
neptls pow demo --difficulty 3

Transport matrix

Transport Default Extra Multiplexing Unavailable behavior
HTTP/1.1 Yes None No Always available
HTTP/2 No neptls[http2] Yes Explicit error
HTTP/3 No neptls[http3] Yes Explicit error

Security boundary

NepTLS is for systems you own or are explicitly authorized to test. It supports HTTP compatibility, TLS inspection, diagnostics, performance testing, protocol research, and defensive automation.

It intentionally does not provide:

  • CAPTCHA solving or anti-abuse evasion
  • Credential attacks or password guessing
  • Session theft or authentication bypass
  • Payment-security bypass
  • Tools intended to defeat access controls

Browser profiles describe compatible headers and metadata. They do not promise browser TLS spoofing or a way around a security control.

Project layout

src/neptls/          Core Python package
tests/               Standard-library unittest suite
docs/                Long-form API and practical wiki
artifacts/neptls-docs/  React/Vite documentation website
.github/             CI, release automation, community health files
scripts/             Release and changelog helpers

Development

git clone https://github.com/diwashuker/NepTLS-Python-Packagee.git
cd NepTLS-Python-Packagee

PYTHONPATH=src python -m unittest discover -s tests -v
PYTHONPATH=src python -m compileall -q src

pnpm install --frozen-lockfile
pnpm --filter @workspace/neptls-docs run typecheck
PORT=18665 BASE_PATH=/ pnpm --filter @workspace/neptls-docs run build

python -m build --sdist --wheel
python -m twine check dist/*

Before opening a pull request, read CONTRIBUTING.md, SECURITY.md, and the Code of Conduct.

Documentation

License and credits

NepTLS is released under the MIT License.

Developed by Diwas Khatri — @diwaskhatri07.

Metadata

Release files for neptls 0.4.1

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

Source distribution (sdist)

Source distribution for neptls 0.4.1
File Size Uploaded Provenance
neptls-0.4.1.tar.gz 31.8 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 63.2 kB

Release files / neptls-0.4.1.tar.gz

Download URL neptls-0.4.1.tar.gz
Size 31.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2073ce7d663775b8847b0dabcd74488a316adbc40734ec579a2372bacc97b0de
BLAKE2b-256 checksum
How to use checksums
cb0a01701254e2e573fef2bba4c16d25f56e8094b28282f52b05f4ceb10206f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Release files / neptls-0.4.1-py3-none-any.whl

Download URL neptls-0.4.1-py3-none-any.whl
Size 31.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8356d6be3eef13a62b4ceb412ad2f70d76d5b0772e076ad91671775af7ccee5
BLAKE2b-256 checksum
How to use checksums
94e8b07b228d71c5b686282393425cd24d32ed87d8879dc3dae9b470aaed931c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.11

Security for neptls 0.4.1

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.

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