All Projects → ANF → pastemyst-rs

ANF / pastemyst-rs

Licence: MIT License
An API Wrapper for https://paste.myst.rs written in rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to pastemyst-rs

nextcloud
Nextcloud OCS and WebDAV API wrapper for Ruby.
Stars: ✭ 16 (+14.29%)
Mutual labels:  api-wrapper
WikidataQueryServiceR
An R package for the Wikidata Query Service API
Stars: ✭ 23 (+64.29%)
Mutual labels:  api-wrapper
pushover
Go wrapper for the Pushover API
Stars: ✭ 112 (+700%)
Mutual labels:  api-wrapper
ReplAPI.it-NodeJS
[DEPRECIATED] 𝙀𝙫𝙚𝙧𝙮𝙩𝙝𝙞𝙣𝙜 𝙍𝙚𝙥𝙡𝙞𝙩, 𝙖𝙡𝙡 𝙖𝙩 𝙮𝙤𝙪𝙧 𝙙𝙞𝙨𝙥𝙤𝙨𝙖𝙡. This is the single most extensive Replit package, allowing you to access various parts of the site with just a few classes and methods. Maintained by @RayhanADev.
Stars: ✭ 32 (+128.57%)
Mutual labels:  api-wrapper
ro.py
ro.py is a modern, asynchronous Python 3 wrapper for the Roblox API.
Stars: ✭ 65 (+364.29%)
Mutual labels:  api-wrapper
coinmarketcap-api
CoinMarketCap.com API PHP wrapper
Stars: ✭ 26 (+85.71%)
Mutual labels:  api-wrapper
primeuploads-py
An unoffcial python API client for primeuploads.com
Stars: ✭ 40 (+185.71%)
Mutual labels:  api-wrapper
doing-cli
CLI tool to simplify the development workflow on azure devops
Stars: ✭ 19 (+35.71%)
Mutual labels:  api-wrapper
node-steamapi
A nice Steam API wrapper for nodejs
Stars: ✭ 112 (+700%)
Mutual labels:  api-wrapper
gemini-python
A python client for the Gemini API and Websocket
Stars: ✭ 71 (+407.14%)
Mutual labels:  api-wrapper
blscrapeR
A tool to gather, analyze and visualize data from the Bureau of Labor Statistics (BLS) API. Functions include segmentation, geographic analysis and visualization.
Stars: ✭ 89 (+535.71%)
Mutual labels:  api-wrapper
radiobrowser4j
RadioBrowser Java API library
Stars: ✭ 30 (+114.29%)
Mutual labels:  api-wrapper
galytics3
Обертка над стандартной библиотекой google_api_python_client для легкой работы с API Google Analytics v3
Stars: ✭ 16 (+14.29%)
Mutual labels:  api-wrapper
digitalocean
A prototype API for Digital Ocean.
Stars: ✭ 35 (+150%)
Mutual labels:  api-wrapper
oxford dictionary
📙 A Ruby wrapper for the Oxford Dictionary API
Stars: ✭ 23 (+64.29%)
Mutual labels:  api-wrapper
ramapi
Python implementation for the Rick and Morty API
Stars: ✭ 17 (+21.43%)
Mutual labels:  api-wrapper
cryptocompare
Python3 Wrapper for the CryptoCompare API
Stars: ✭ 147 (+950%)
Mutual labels:  api-wrapper
rredlist
IUCN Red List API Client
Stars: ✭ 31 (+121.43%)
Mutual labels:  api-wrapper
poloniex-api
PHP wrapper for the Poloniex API
Stars: ✭ 20 (+42.86%)
Mutual labels:  api-wrapper
Python-SmartisanNotes
Python API Wrapper for http://note.t.tt Service.(锤子便签)
Stars: ✭ 39 (+178.57%)
Mutual labels:  api-wrapper


PasteMyst.RS

pastemyst-rs is an api wrapper for pastemyst written in Rust.

This package is under development

Sample usage

To get a paste from pastemyst synchronously:

use pastemyst::paste;
use pastemyst::paste::PasteObject;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let paste: PasteObject = paste::get_paste("hipfqanx")?;
    println!("{}", paste.pasties[1].language);
    Ok(())
}

To create paste synchronously:

use pastemyst::paste;
use pastemyst::paste::PasteObject;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let pasties: Vec<PastyObject> = vec![
        PastyObject {
            _id: str!(""),
            language: str!(pastemyst::data::language::RUST),
            title: "A pasty title".to_string(),
            code: String::from("fn main() { println!(\"Hello World!\"); }"),
        },
        PastyObject {
            _id: str!(""),
            title: "Another pasty title".to_string(),
            language: str!(pastemyst::data::language::CLANG),
            code: String::from("#include \"stdio.h\"\n\nint main() {\n\tprintf(\"Hello World!\");\n}"),
        },
    ];
    let data: CreateObject = CreateObject {
        title: String::from("[crates.io/crates/pastemyst] This is a title"),
        expiresIn: String::from("1d"),
        isPrivate: false,
        isPublic: false,
        tags: String::from(""),
        pasties: pasties,
    };
    let paste /*: reqwest::Response*/ = paste::create_paste(data).unwrap(); // You don't need to add the commented part, that's jut for your information.
    println!("{}", paste._id);
    Ok(())
}

More from the examples and documentation.

Feature support

Feature Support Async
API v1
API v2
Get pastes
Get private pastes
Create pastes
Create Private pastes*
Edit pastes
Delete pastes
Get Users
Check if a user exists
Get a language by name
Get a language by extension
Time expires in to a unix timestamp

= Done/Implemented and fully functional

= Not done/implemented

= N/A

*This also includes a paste to be tied to your account, or create a private/public paste, or with tags.

Repository structure

This is the current structure of the code:

./
├───.github/
│   ├─.workflows/
│   │   └─ rust.yml
│   └─ISSUE_TEMPLATES/
│       ├─ bug_report.md
│       ├─ feature_request.md
│       ├─ documentation.md
│       └─ question.md
├───examples/
│   ├─ paste.rs
│   ├─ time.rs
│   ├─ data.rs
│   └─ user.rs
├───images/
│   └─ RustMyst.png
├───src/
│   ├─ data.rs
│   ├─ discord.rs
│   ├─ lib.rs
│   ├─ paste.rs
│   ├─ time.rs
│   └─ user.rs
├─── .gitattributes 
├─── .gitignore
├─── Cargo.toml
├─── CHANGELOG.MD
├─── LICENSE
└─── README.MD

Building and Running

Being a Rust library, pastemyst-rs requires the Rust compiler installed. To check if it's installed, run: rustc --version and cargo --version to verify it. If it's not installed, install it from their site. Once that's cleared out; run cargo install to get the packages. To test it on-hand, either

  1. Create a main.rs with the main method and run those tests (cargo run).
  2. Run from the examples using cargo run --example example_name, for example cargo run --example get_paste.

Installation

If you want to use it in your rust application, it is recommended to get the crate from https://crates.io/crates/pastemyst. In your Cargo.toml file, under [dependencies] paste this:

pastemyst = "<Replace this text with the latest version>"
# OR
pastemyst = { version = "<Replace this text with the latest version>" }

Versioning

pastemyst-rs uses SemVer.

Given a version number MAJOR.MINOR.PATCH, increment the

MAJOR version when you make incompatible API changes,

MINOR version when you add functionality in a backwards compatible manner, and

PATCH version when you make backwards compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

Help/Assistance

You can create an issue or just join the support (discord) server.

Discuss in the server

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].