Subject: [PATCH] gnu: Add python-sodapy.

From: Luis Felipe <[email-masked]>
Date: Tue, 23 Nov 2021 19:22:27 +0000

Hi, this is a new package pretty much imported by Guix from Pypi. I installed it, tried it out with the following code in a Python interpreter, and it worked.

~~~
from sodapy import Socrata

client = Socrata("www.datos.gov.co", None)

# First 100 results, returned as JSON from API / converted to Python list of
# dictionaries by sodapy.
results = client.get("gt2j-8ykr", limit=100)

results
~~~

I then generated the attached patch by following the packaging videos (https://guix.gnu.org/en/videos/2020/packaging-part-one/).

I hope it works (but I can make changes if it doesn't),

---
Luis Felipe López Acevedo
https://luis-felipe.gitlab.io/

From 8f605da8ac3157b467cc2fcc6b5ec83cfa436daf Mon Sep 17 00:00:00 2001
From: Luis Felipe <[email-masked]>
Date: Tue, 23 Nov 2021 13:30:04 -0500
Subject: [PATCH] gnu: Add python-sodapy.

* gnu/packages/python-web.scm (python-sodapy): New variable.
---
 gnu/packages/python-web.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 4ddf89c207..71fc0549aa 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -46,6 +46,7 @@
 ;;; Copyright © 2021 Pradana Aumars <[email-masked]>
 ;;; Copyright © 2021 Arun Isaac <[email-masked]>
 ;;; Copyright © 2021 jgart <[email-masked]>
+;;; Copyright © 2021 Luis Felipe López Acevedo <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -6348,3 +6349,20 @@ (define-public python-flask-combo-jsonapi
 Flask-RESTful to quickly build APIs that fit the complexity of existing
 real-life projects with legacy data and diverse storage providers.")
     (license license:expat)))
+
+(define-public python-sodapy
+  (package
+    (name "python-sodapy")
+    (version "2.1.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "sodapy" version))
+       (sha256
+        (base32 "03ywf14fplgrz15ci6lvj1kmbrd0sghvcmjbnarx4036q7ph3rs4"))))
+    (build-system python-build-system)
+    (propagated-inputs `(("python-requests" ,python-requests)))
+    (home-page "https://github.com/xmunoz/sodapy")
+    (synopsis "Python library for the Socrata Open Data API")
+    (description "Python library for the Socrata Open Data API.")
+    (license license:expat)))
-- 
2.33.0