semvec/pypi-packages huggingface dataset:
arcstack-django-api 0.2.1
Create APIs in Django way
License: MIT
Requires Python: >=3.10
Keywords: api, django, rest, framework, api-framework, class-based-views

# ArcStack Django API Framework

[![Tests](https://github.com/gwainor/arcstack-django-api/actions/workflows/test.yml/badge.svg?branch=master&event=push)](https://github.com/gwainor/arcstack-django-api/actions/workflows/test.yml)

This is a simple yet extensible API framework for Django that you can create API
endpoints Django way.

Check out [Documentation](https://gwainor.github.io/arcstack-django-api/) for
more info.


## Sponsoring

Maintaining an open-source project requires attention and time. If you like this
project and want it to be developed further, you might want to consider giving
me a support.

If you are using ArcStack API in your project, please give me your feedback at
[me@gokhan.tr](mailto:me@gokhan.tr).


## Installation

```sh
pip install arcstack-django-api
```


## Usage

ArcStack Django API comes with `CommonMiddleware` enabled. This middleware
can convert your endpoint results to `HttpResponse`, handle exceptions and
check for logged in users.

Usage with class-based views:

```python
from arcstack_api import Endpoint, APIError

class StatusOk(Endpoint):
    # By default all defined enpoints do not require logged in user
    # You can change this behavior with this class constant.
    LOGIN_REQUIRED = True

    def get(self, request, a: str | None = None):
        if a == "something_invalid":
            # This `dict` will be converted to `JSON` and `HttpResponse`
            # will be generated
            raise APIError(
                {"error": "you have passed invalid argument"}
                # The default status_code is `400` but it can be changed to
                # anything you want.
                status_code=480
            )

        # ArcStack API will serialize this to JSON and generate
        # a `HttpResponse` for you.
        return {"status": "OK"}
```

Usage with function views:

```python
from arcstack_api import api_endpoint, Endpoint, APIError

@api_endpoint(login_required=True)
def statusOk(request, a: str | None = None):
    if a == "something_invalid":
        raise APIError(
            {"error": "you have passed invalid argument"}
            status_code=480
        )

    return {"status": "OK"}
```

In `urls.py`

```python
from django.urls import path

from . import endpoints

urlpatterns = [
    # For class-based views:
    path("api", endpoints.StatusOk.as_endpoint()),
    # For function views:
    path("api", endpoints.statusOk),
]
```
rst2gfm 0.1.2
A tool to convert reStructuredText to GitHub Flavored Markdown
License: MIT
Requires Python: >=3.6

# rst2gfm - reStructuredText to GitHub Flavored Markdown Converter

A Python tool that converts reStructuredText (RST) documents to GitHub Flavored Markdown (GFM).

## Features

- Converts RST documents to GitHub Flavored Markdown
- Preserves document structure including headings, paragraphs, and formatting
- Supports common RST elements:
  - Headers/sections
  - Text formatting (bold, italic)
  - Code blocks with language highlighting
  - Lists (bullet and enumerated)
  - Tables
  - Links
  - Images
  - Block quotes
  - Definition lists

## Installation

```bash
pip install rst2gfm
```

Or install from source:

```bash
git clone https://github.com/pdh/rst2gfm.git
cd rst2gfm
pip install -e .
```

## Usage

### Command Line

Convert an RST file to Markdown:

```bash
rst2gfm input.rst -o output.md
```

Use stdin/stdout:

```bash
cat input.rst | rst2gfm > output.md
```

### Python API

```python
from rst2gfm import convert_rst_to_md

# Convert RST string to Markdown
rst_content = "**Bold text** in reStructuredText"
md_content = convert_rst_to_md(rst_content)
print(md_content)

# Convert RST file to Markdown file
with open('input.rst', 'r') as f:
    rst_content = f.read()

md_content = convert_rst_to_md(rst_content)

with open('output.md', 'w') as f:
    f.write(md_content)
```

## Limitations

This converter handles most common RST elements, but some advanced features may not be fully supported:

- Complex nested structures
- Custom RST directives
- Some Sphinx-specific extensions

## Development

### Running Tests

```bash
pip install pytest
pytest
```