GithubHelp home page GithubHelp logo

kylemikableh / piprintapi Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 41 KB

Welcome to PiPrint API. This project, under the MIT License, is a Python Flask server that allows anyone to send REST requests for printing to a printer of their choice.

License: MIT License

Python 100.00%
dotmatrix printer rest-api api api-rest

piprintapi's Introduction

PiPrint API

About

Welcome to PiPrint API. This project, under the MIT License, is a Python Flask server that allows anyone to send REST requests for printing to a printer of their choice.

Why?

The idea for the program was created when I acquired an OKIData Microline 186 9 Pin DotMatrix printer. The goal for this printer was to have a constantly printing "log" that prints line-by-line as it receives requests. I hoped to find a program that could do this for me, so that I could send alert and information data from any other program and the result will be a central log for all programs in my apartment.

How to use

Development Mode (All Operating Systems)

  1. You must have Python 3.7 or later installed
  2. Download the project
  3. After downloading the project, you must run the requirements.txt through Python's PIP to install the required modules:
pip install -r requirements.txt
  1. Next, you will run the program:
python3 main.py
  1. The program will next prompt the user to give some config details, follow the prompt
  2. At this point, the development server will be running and the required files will be generated (keys.txt,print.log, and temmprint.txt)
  3. The prompt will give you a URL to access the website, follow the link
  4. At this point you are now on the program! You must now navigate to the url: /print
  5. Here, it will warn you that there is no API key. You must supply the API key at the end of the url using the format: /print?key=[KEY] where [KEY] is you key you created during the setup.
  6. Now, it should warn you that you have not given any data. This is the last step! Append the data to the end of the URL: /print?key=[KEY]&pdata=[DATA] where [DATA] is the text you want printed to the log file and printer. For example:
/print?key=12345678abcd&pdata=Hello%20World!
  1. NOTE: To add a space to printed data, you must use the URL space of %20 in the URL wherever a whitespace is wanted.

piprintapi's People

Contributors

kylemikableh avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

jamshidults

piprintapi's Issues

Proper README

Create a proper README for documentation and to help others.

Need a config.yml

I want a way to configure easily for users. Currently there is an interactive prompt when you first run the program, but this needs a lot more such as CUPS command to execute if so desired etc.

Off By One when printing to CUPS

When the program prints to CUPS, it is always off by one. For example, print a line "Hello" and then print "Hello1" only Hello prints. If you then print "Hello2" now "Hello1" will print.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.