semvec/pypi-packages huggingface dataset:
ymd-prompt 0.3.0
Load, validate, and render YMD (YAML + Markdown) prompt files with Pydantic + Jinja2.
Requires Python: >=3.11
Keywords: prompt, yaml, markdown, ymd, jinja2, llm

# YMD Prompt

<p align="center">
  <a href="http://daviguides.github.io"><img src="https://img.shields.io/badge/built%20with-%E2%9D%A4%EF%B8%8F%20by%20Davi%20Guides-orange"></a>
  <img src="https://img.shields.io/badge/tests-passing-brightgreen">
  <img src="https://img.shields.io/badge/coverage-100%25-brightgreen">
  <a href="./LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg"></a>
</p>

**YMD Prompt** is a small Python library + CLI to **load**, **validate**, and **render**  
`.ymd` / `.yamd` files — a hybrid format where YAML holds metadata and Markdown holds prompt text.

---

## ✨ Features
- ✅ Pydantic models for strict validation (`id`, `kind`, `version`, `title`, sections)
- 📥 Loader: `load(path)` and `loads(text)` using `yaml.safe_load`
- 🧩 Rendering with Jinja2: `render(prompt, context)` replaces `{{var}}`
- 🔎 Placeholder discovery: `list_placeholders()`
- 🔒 `strict_placeholders=True` to enforce completeness
- 🖥️ CLI: `ymd` for rendering and placeholder inspection

---

## 🚀 Install
```bash
pip install ymd
```

---

## 📚 Library usage
```python
from ymd import load, render, list_placeholders

p = load("examples/sample.ymd")
needed = list_placeholders(p.sections())
print("placeholders:", needed)

out = render(p, {"diff": "+++ simulated diff +++"})
print(out["user"])
```

---

## 🖥️ CLI usage
```bash
# Render and print JSON with all sections
ymd render examples/sample.ymd --var diff="@examples/diff.txt"

# Render a single section to stdout
ymd render examples/sample.ymd --var diff="+++diff+++" --section user

# Render all sections into separate files under out/
ymd render examples/sample.ymd --var diff="+++diff+++" --outdir out

# List placeholders
ymd placeholders examples/sample.ymd
```

### Options
```
--var KEY=VALUE         # add a single variable (use @path to read from file)
--vars-json PATH        # load a JSON file with variables
--section NAME          # only print given section (system|instructions|user...)
--outdir DIR            # write rendered sections to files (NAME.md)
--no-strict             # allow missing placeholders (render empty string)
--format json|md        # output format (default: json; md prints a combined document)
```

---

## 📂 Example
See [examples/sample.ymd](examples/sample.ymd).

---

## ⚖️ License
MIT
quave-sdk 0.1.2
Python SDK for the Quave quantum computing platform
Requires Python: >=3.8

# Quave SDK

`quave-sdk` provides a Python interface to Quave's platform for executing 
quantum circuits, and retrieving results in hybrid quantum-classical workflows. 

## Installation

```bash
# For users
pip install quave-sdk

# For developers
pip install -e .
```

## Usage

```python
from qiskit import QuantumCircuit
from quave_sdk.quave import Quave

# --- 1. Authentication ---

# initialize a quave object using environment variable authentication
import os
email = os.getenv("EMAIL")
password = os.getenv("PASSWORD")
quave = Quave(email, password)

# or using command line inputs
quave = Quave()


# --- 2. View Backends ---

# see all available backends
backends = quave.list_backends()

# or for a specific QPU provider
backends = quave.list_backends("ibm")

# retrieve statistics for a specific backend
backend_stats = quave.get_backend_stats(backend_name="ibm_brisbane")


# --- 3. Simple Execution (No Parameters) ---

# build a simple circuit
qc = QuantumCircuit(1)
qc.h(0)
qc.t(0)
qc.measure_all()

# execute the circuit
job = quave.execute(circuit=qc, shots=10, backend="AerSimulator")

# check the status and retrieve counts
status = job.get_status()
if status == "COMPLETED":
    execution = job.get_executions()[0]
    counts = execution.get_counts()

# or wait for the job to be complete
asyncio.run(job.await_completion())
execution = job.get_executions()[0]
counts = execution.get_counts()

# --- 4. Batch Execution (Parameterized Circuit) ---

# define a simple parameterized circuit
theta = Parameter("θ")
qc = QuantumCircuit(1, 1)
qc.rx(theta, 0)
qc.measure(0, 0)

# define parameter values
from math import pi
params = [{"θ": x * pi/2} for x in range(5)]

# execute the job and await completion
job = quave.execute(circuit=qc, parameters=params, shots=10, backend="AerSimulator")
asyncio.run(job.await_completion())

# retrieve counts for each execution
executions = job.get_executions()
for x in executions:
    print(f"Counts for parameters {x.parameters}: {x.get_counts()}")


# --- 5. Iterative Execution ---

# define a function to generate new parameters from result counts
def update_parameters(counts):
    if counts.get("0", 0) > 0:
        return {"θ": pi}
    else:
        return {"θ": 0}

# execute the iterative workload
job = asyncio.run(quave.iterative_execute(
    circuit=qc, 
    parameter_update_fn=update_parameters, 
    initial_parameters={"θ": 0}, 
    num_iterations=3, 
    shots=10, 
    backend="AerSimulator"
))

# retrieve the counts for each iteration
executions = job.get_executions()
for x in executions:
    print(f"Counts for parameters {x.parameters}: {x.get_counts()}")

```
jaxcapse 0.1.2
JAX implementation of the Capse emulator.
Requires Python: <4.0,>=3.10

# jaxcapse
[![codecov](https://codecov.io/gh/CosmologicalEmulators/jaxcapse/graph/badge.svg?token=D6VJ14G46U)](https://codecov.io/gh/CosmologicalEmulators/jaxcapse)
[![arXiv](https://img.shields.io/badge/arXiv-2307.14339-b31b1b.svg)](https://arxiv.org/abs/2307.14339)

Repo containing the jaxcapse emulator.

## Installation and usage

In order to install `jaxcapse`, you can just run

```bash
pip install jaxcapse
```

If you prefer to use the latest version from the repository, you can clone it, enter it, and run

```bash
pip install .
```

In order to use the emulators, you have to import `jaxcapse` and load a trained emulator

```python3
import jaxcapse
import jax.numpy as np
trained_emu = jaxcapse.load_emulator("/path/to/emu/")
```
Then you are good to! You have to create an input array and retrieve your calculation result

```python3
input_array = np.array([...]) #write in the relevant numbers
result = trained_emu.get_Cl(input_array)
```

For a more detailed explanation, check the tutorial in the `notebooks` folder, which also shows a comparison with the standard `CAMB` Boltzmann solver.

## Citing

Free usage of the software in this repository is provided, given that you cite our release paper.

M. Bonici, F. Bianchini, J. Ruiz-Zapatero, [_Capse: efficient and auto-differentiable CMB power spectra emulation_](https://arxiv.org/abs/2307.14339)
ans-project-sdk 0.0.6
Python SDK for the Agent Network System (ANS)
Requires Python: >=3.7
Keywords: ans, agent, sdk, cli, lookup, discovery, ai-agent

# ANS Python SDK

Python SDK for interacting with the Agent Network System (ANS).

## Installation

Install from PyPI:

```bash
pip install ans-project-sdk
```

## Usage

### ANSClient

The main entry point for the SDK is the `ANSClient` class.

```python
from ans_project.sdk import ANSClient

client = ANSClient() # Defaults to public ANS endpoint

# Generate a new key pair
public_key, private_key = ANSClient.generate_key_pair()

# Register an agent
agent_data = {
    "agent_id": "my-python-agent.ans",
    "name": "My Python Agent",
    "capabilities": ["python_sdk_test"],
    "public_key": public_key
}
try:
    response = client.register(agent_data, private_key)
    print("Registration successful:", response)
except Exception as e:
    print("Registration failed:", e)


# Lookup an agent
try:
    response = client.lookup({"agent_id": "my-python-agent.ans"})
    print("Lookup successful:", response)
except Exception as e:
    print("Lookup failed:", e)
```

### anslookup CLI

The SDK includes a command-line interface tool, `anslookup`, for quickly querying the Agent Network System.

To use it, ensure the SDK is installed (e.g., `pip install ans-project-sdk`) 

```bash
# Get help and see all options
anslookup --help

# Lookup an agent by its ID
anslookup my-python-agent.ans

# Lookup agents by name and trust level
anslookup --query "Nexus Voyager" --trust-level "provisional"

# Lookup agents by capabilities (use quotes for capabilities with spaces)
anslookup --capabilities "discovery,learning"
```

### Payload Validation

The SDK uses `Pydantic` to perform client-side validation on the `register` method's payload. This ensures that the data conforms to the ANS backend schema before it is sent, providing fast and clear error messages.

For example, if you try to register an agent without the required `name` field:

```python
# Invalid payload (missing 'name')
invalid_agent_data = {
    "agent_id": "invalid-agent.ans",
    "public_key": public_key
}

try:
    client.register(invalid_agent_data, private_key)
except ValueError as e:
    print(f"Validation failed as expected: {e}")
```

This will immediately raise a `ValueError` with a detailed message about the missing field, preventing an unnecessary API call.

### Key Management

The `generate_key_pair` method returns a new public/private key pair in PEM format. **The private key must be stored securely and should not be checked into version control.**

For production applications, use a secure secret management system like Google Secret Manager.

## Changelog

### 0.0.5 (2025-09-14)

*   **Fixed:** Resolved `ModuleNotFoundError` when importing `ans_project.sdk` after `pip install`. The package structure has been corrected to ensure `ans_project` is a top-level importable module.