semvec/pypi-packages huggingface dataset:
pyRDF 2.3.2
Lightweight RDF Stream Parser
Requires Python: >=3.8
Keywords: rdf, ntriples, nquads, rdf-star, parser, streamer

# Lightweight RDF Stream Parser for Python

A lightweight RDF and RDF-Star parser which streams triples directly from disk
or standard input without loading the entire graph into memory.

Supports the N-Triples and N-Quads serialization format.

## Usage

Read and write to disk.

```python
from rdf import NTriples
from rdf import Literal

with NTriples(path = "./pizzacats.nt", mode = 'r') as g:
    with NTriples(path = "./out.nt", mode = 'w') as h:
        for subject, predicate, object in g.parse():
            if type(object) is Literal and object.language == "en":
                # do stuff
            h.write((subject, predicate, object))
```

Read / write from standard input / output.

```python
from os import stdin
from rdf import NQuads
from rdf import IRIRef

g = NQuads(data=stdin.read(), mode = 'r')
h = NQuads(mode = 'w')

target = IRIRef("https://example.org/Pizzacat")
for triple in g.parse():
    if triple[0] == target:  # subject
        # do stuff
        h.write(triple)
        
g.close()
h.close()
```

Adding new triples.

```python
from rdf import IRIRef, Literal, Statement
from rdf import RDF, XSD

EX = IRIRef("https://example.org/")  # define prefix
g = set()

subject = EX + "Pizzacat"
g.add(Statement(subject, RDF+"type", EX+"Cat"))

literal = Literal("Samurai Pizza Cats!!!", datatype=XSD+"string")
g.add(Statement(subject, EX+"tag_phrase", literal))
```
jsonbot 1.0.6
A simple Json object to Bot library built on top of a osonbot library
Requires Python: >=3.10

# JsonBot

# Installation
```shell
pip install jsonbot
```

# Usage
```python
from jsonbot import JsonBot

JsonBot("token", {
    "messages": {
        "/start", {"response": "hello *{first_name}*", "parse_mode": "MarkdownV2", "reply_markup"},
        "/help": {"response": "Hello how can i help you"}
    }
}).run()
```
## you can generate code to osonbot library itself (but not fully prepared)
```python
from jsonbot import JsonBot

JsonBot("token", {
    "/start", {"response": "hello *{first_name}*", "parse_mode": "MarkdownV2"},
    "/help": {"response": "Hello how can i help you"}
}).generate_code(library="osonbot", file="main.py")
```
## Handling Inline Messages
```python
from jsonbot import JsonBot

JsonBot("token", {
    "inline_messages": {
        "callback_data1", {"response": "you clicked the first inline button"},
        "callback_data2": {"response": "you clicked the sedond inline button"}
    }
}).run()
```
# Done