timpile

timpile

Handwrite - Unofficial API wrapper for Handwrite.io

I started using the Handwrite REST API for a side project and since they don’t have an API library for Elixir I decided to make an unofficial one for them: https://hex.pm/packages/handwrite.

This is my first published Hex package and I have only used Elixir for side projects, so I’d love to make this library more stable and usable. I’m sure there is a lot of improve on, so any feedback or code reviews would be greatly appreciated!

Most Liked

timpile

timpile

I’m still only using it in a sandbox environment, but as far as I can tell the pricing is comparable to other card printing services. They are very responsive, if you reach out to them I’m sure they can give you a better answer.

chulkilee

chulkilee

Welcome! My first hex package was also a rest api wrapper (ex_force) :slight_smile:

Here are some feedback/thoughts:

Dependency

  • Although they are mostly swappable, recent packages chose jason instead of poison for json
  • http client - I’m using tesla whenever possible since users can swap the http library easily.

Handwrite.Client

  • Instead of "#{secret_key()}", you can make sure secret_key returns string value… which leads to the next point
  • secret_key/0 calls System.get_env/1 on runtime - it may be okay for application (although not recommended), but for library, you should use application configuration (e.g. Application.get_env/3) (for global config) or pass that value down to the function.

Code organization

  • I found you made a module for each resource - such as Handwrite.Endpoint.Handwriting. There is no right answer, but I found it’s actually easier to read, use, and maintain the code I put the all things under one module if they’re at the similar level resources. See ExForce module source.

Where Next?

Popular in Libraries Top

scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
praveenperera
FastRSS Parse RSS feeds very quickly: This is rust NIF built using rustler Uses the RSS rust crate to do the actual RSS parsing Speed...
New
MRdotB
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
Crowdhailer
Experimenting with this code. OK.try do user <- fetch_user(1) cart <- fetch_cart(1) order = checkout(cart, user) save_or...
New
gabrielpoca
Hello everyone! I want to share with you something that I’m really proud of: https://stillstatic.io/ Still is a static site builder for...
New
Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Th...
New
mattludwigs
Grizzly is a library for working with Z-Wave devices. Z-Wave is a low-frequency radio protocol for controlling smart home devices on a me...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

Sub Categories:

We're in Beta

About us Mission Statement