semvec/pypi-packages huggingface dataset:
nbsdata 1.0.1
Data from National Bureau of Statistics, China
Requires Python: >=3.12
Keywords: data, NBS, China, sn-stats

# Retrieving Data from China National Bureau of Statistics

<https://data.stats.gov.cn/easyquery.htm>

## Installation

```
pip install nbsdata
```

## Usage

```
from nbsdata import NBS
bs = NBS()
```

### Get Databases

```
bs.databases
```

### Get Region Codes

province-level or city-level

```
bs.regioncode('浙江')   # 330000
bs.regioncode('杭州', city = True)   # 330100
```

### Query Indicator Codes

Indicator codes for each database are retrived with module `get_nbs_indicators` (in directory 'rhopy')

Indicator data files are stored in package's 'asset' directory. The indicators are somewhat stable. We will update them if needed.

To update these files, run related function in module 'get_nbs_indicators'

NB: With method 'indicatorcode()', we can only get those indicators which appear in the selection bar on the left in the official pages. Those leaf-level indicators which only appear in the table need to be queried with 'leafindicator()' further

```
bs.indicatorcode('fsjd', '可支配收入')
bs.leafindicator('fsjd', 'A0301')
```

### National Data

**Case**: Annual data of GDP in the last 5 years ('LAST5', mrv = 5)

Step 1: query indicator code

```
bs.indicatorcode('hgnd', '生产总值')
```

Now we can get the code: 'A0201'

Step 2: get data

```
gdp = bs.nationaldata('hgnd', 'A0201', 'LAST5')
```

We can see indicator code 'A0201' contains the following sub-codes: 'A010101' (国民总收入), 'A020102' (国内生产总值), ..., 'A020106' (人均国内生产总值)

Step 3:

Filter from the dataframe above

```
import polars as pl
gdp.filter(pl.col('indicator_code') == 'A020102')
```

Or retrieve data again with subcode 'A020102'

```

bs.nationaldata('hgnd', 'A020102', 'LAST5')
```

### Regional Data

For single region (e.g. Zhejiang), we can retrieve data with either category-level or leaf-level indicator; for all regions, we can only use leaf-level indicator, or you will only get the data of the first subcode of the category-level indicator.

**Case 1**: Quarterly data of urban disposable income of Zhejiang from '2010Q1' to '2025Q3'

Step 1: query indicator code

```
bs.indicatorcode('fsjd', '城镇居民.+可支配收入')
```

We get nothing, because the indicator code is not available. Loose the query condition

```
bs.indicatorcode('fsjd', '可支配收入')
```

Now we get one item named '居民人均可支配收入', the code is 'A0301'

Step 2: get data with code 'A0301'

```
bs.regionaldata('fsjd', 'A0301', '2010A-2025C', '330000')
```

The result above contains the following subcodes: 'A030101' (居民人均可支配收入), 'A030102' (城镇居民人均可支配收入), 'A030103' (农村居民人均可支配收入)

Step 3: Filter data or retrieve data again with subcode 'A030102'

**Case 2**: Quarterly data of urban disposable income of of All provinces from '2020Q1' to '2025Q3'

Use category-level indicator, say, 'A0301'

```
bs.leafindicator('fsjd', 'A0301')
bs.regionaldata('fsjd', 'A030102', '2020A-2025C')
```
shipyard-python-sdk 0.2.4
Shipyard Python SDK is an agent sandbox sdk
Requires Python: >=3.10

# Shipyard Python SDK

A Python SDK for interacting with Shipyard containerized execution environments.

## Installation

```bash
pip install aiohttp
```

## Quick Start

```python
import asyncio
from shipyard_python_sdk import ShipyardClient, Spec, create_session_ship

async def main():
    # Option 1: Using client directly
    client = ShipyardClient(
        endpoint_url="http://localhost:8000",
        access_token="your-token"
    )
    
    ship = await client.create_ship(
        ttl=3600,  # 1 hour
        spec=Spec(cpus=1.0, memory="512m"),
        max_session_num=5
    )
    
    # Use the ship
    await ship.fs.create_file("hello.txt", "Hello, World!")
    result = await ship.fs.read_file("hello.txt")
    print(result["content"])
    
    # Option 2: Using convenience function
    ship = await create_session_ship(
        ttl=1800,
        spec=Spec(cpus=0.5, memory="256m")
    )
    
    await client.close()

if __name__ == "__main__":
    asyncio.run(main())
```

## File Structure

```
shipyard_python_sdk/
├── __init__.py          # Main package exports
├── types.py             # Type definitions and data models
├── client.py            # Main ShipyardClient implementation
├── session.py           # SessionShip implementation
├── filesystem.py        # File system operations component
├── shell.py             # Shell operations component
├── python.py            # Python/IPython operations component
├── utils.py             # Convenience functions
└── examples.py          # Usage examples
```

## Components

### ShipyardClient
Main client class for interacting with the Bay API.

### SessionShip
Represents a ship session with three main components:
- `ship.fs` - File system operations
- `ship.shell` - Shell command execution  
- `ship.python` - Python code execution

### Spec
Resource specification for ships:
```python
spec = Spec(cpus=2.0, memory="1g")
```

## Environment Variables

- `SHIPYARD_ENDPOINT` - Bay API endpoint URL
- `SHIPYARD_TOKEN` - Access token for authentication

## Error Handling

All operations can raise exceptions. Wrap calls in try-catch blocks:

```python
try:
    result = await ship.fs.read_file("nonexistent.txt")
except Exception as e:
    print(f"Error: {e}")
```

## Examples

See `examples.py` for comprehensive usage examples including:
- Basic file operations
- Shell command execution
- Python code execution with persistent variables
- Background processes
- Error handling patterns
simple-pdf-cli 0.2.1
A simple CLI app for basic PDF modifications.
Requires Python: >=3.10
Keywords: cli, compress-pdf, merge-pdf, pdf, pdf-decrypt, pdf-encrypt, pdf-split, pdf-to-image, pdf-tools, pdf-trim

[![PyPI - Version](https://img.shields.io/pypi/v/simple-pdf-cli)](https://pypi.org/project/simple-pdf-cli/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/simple-pdf-cli) ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/Falachi/simple-pdf-cli/publish-to-pypi.yml) ![PyPI - License](https://img.shields.io/pypi/l/simple-pdf-cli)

# Simple PDF-CLI

Simple PDF-CLI is a simple Python CLI app to edit PDFs directly from the terminal. Install with pip: `pip install simple-pdf-cli`

Current features:

- Merge multiple PDFs
- Convert PDF to images
- Combine images to a PDF
- Reorder pages of a PDF
- Trim pages of a PDF
- Split a PDF into multiple PDFs
- Encrypt a PDF
- Decrypt a PDF
- Compress a PDF

Testing photos by [Pavel Moiseev](https://unsplash.com/@pavelmois?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on Unsplash.

### Note:
The PDF to Images feature requires **poppler** to function.

**Windows**

I recommend using [Scoop](https://scoop.sh/#/) for easy installation. `scoop install poppler`

Otherwise you can download manually from [here](https://github.com/oschwartz10612/poppler-windows) and add the `bin` directory to PATH.

**MacOS**

You can use Homebrew to install.
`brew install poppler`

**Linux**

Install `poppler-utils` with a package manager of your choice.

## Usage Examples

**Merge**

```bash
pdfcli merge file1.pdf file2.pdf -o merged.pdf
```

**Images to PDF**

```bash
pdfcli image1.png image2.png image3.png -o output.pdf
```

**PDF to Images**

```bash
pdfcli file.pdf -o out_images
```

**Reorder**

```bash
pdfcli input.pdf -o output.pdf -r 3,1,2
```

**Trim**

```bash
pdfcli input.pdf -o output.pdf -p 1-5,7,10-12,9
```

**Split**

```bash
pdfcli split input.pdf -o out_pdfs -p 1-5,3-6,7
```

**Encrypt**

```bash
pdfcli encrypt file.pdf -o output.pdf -p password1
```

**Decrypt**

```bash
pdfcli decrypt file.pdf -o output.pdf -p password1
```

**Compress**

```bash
pdfcli compress input.pdf -o output.pdf -l 6 -q medium
```

## Installation

**Using pip (recommended):**

```bash
pip install simple-pdf-cli
```

**Manual Installation:**

1. Clone the repo

```bash
git clone https://github.com/Falachi/simple-pdf-cli.git
```

2. Go to project directory

```bash
cd simple-pdf-cli
```

3. Install package

```bash
pip install -e .
```

## To-Do List

- [x] Implement proper type and error checking
- [x] Compress PDF
- [x] Split PDF
- [x] Password protect
- [x] Allow a `.txt` file as input for arguments that accept multiple files
- [ ] Edit PDF metadata
- [x] Upload to PyPI
- [ ] Separate CLI and core functions
- [ ] Create a GUI version