semvec/pypi-packages huggingface dataset:
mongodb-schema 0.1.2
A Python SDK for exporting MongoDB schema metadata
Requires Python: >=3.6

# mongodb-schema

A Python SDK for exporting MongoDB schema metadata without copying the actual data.

## Installation

```bash
pip install mongodb-schema
```

## Dependencies

### Requirements.txt Setup

Update your `requirements.txt` to include:

```plaintext
pymongo>=4.10.1
```

Note: Do not include the standalone `bson` package as it conflicts with `pymongo`.

To regenerate requirements:
```bash
pip freeze > requirements.txt
```

To reinstall dependencies:
```bash
pip install --force-reinstall -r requirements.txt
```

### BSON Troubleshooting

If you encounter BSON-related errors, run:
```bash
pip uninstall bson pymongo
pip install pymongo
```

## Usage

### Command Line Interface

```bash
mongodb-schema --uri mongodb://user:password@database.host1.com:27017/admin --databases test2,testIgnore --output schema.json
```

### Python API

```python
from mongodb_schema.exporter import MongoSchemaExporter

# Initialize the exporter with MongoDB connection details
exporter = MongoSchemaExporter(uri="mongodb://localhost:27017", database="test_db")

# Export the schema metadata for the specified database
result = exporter.export_schema(sample_size=10)

# Print the result
print(result)
```

### Arguments

- `--uri`: MongoDB connection string
- `--databases`: Comma-separated list of databases to export
- `--output`: Output file path for schema (e.g., `schema.json`)

### Example Output

```bash
Schema exported to schema.json
```

### Permissions

Ensure your user has appropriate read permissions for the specified databases.
jwt-middleware 2.0.0
JWT Middleware for FastAPI
Requires Python: >=3.6

# jwt_middleware

A module for a middleware for our JWT token decryption. 

Will throw a HTTP exception code 401 in case of missing token, token expiration or invalid token. 

## Installation 
`pip3 install jwt-middleware`

## Usage
```
from fastapi import FastAPI
from jwt_middleware import JWTMiddleware

app = FastAPI()

# Add the JWT middleware
app.middleware("http")(JWTMiddleware(secret_key="your-secret-key"))

@app.get("/")
async def root():
    return {"message": "Welcome, authorized user!"}
```

## Publish a new version 
Pre-requisites: 
```
pip3 install setuptools
pip3 install wheel
pip3 install twine
```

1. Update the version number in setup.py 
2. Build the package: 
```
python3 setup.py sdist bdist_wheel
```
3. Verify the package: 
```
twine check dist/*
```
4. Publish the package: 
```
twine upload dist/*
```