gophers 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gophers-0.0.1/.gitignore +3 -0
- gophers-0.0.1/LICENSE +23 -0
- gophers-0.0.1/PKG-INFO +71 -0
- gophers-0.0.1/README.md +6 -0
- gophers-0.0.1/__init__.py +4 -0
- gophers-0.0.1/__main__.py +8 -0
- gophers-0.0.1/go_module/go.mod +3 -0
- gophers-0.0.1/go_module/gophers.go +18 -0
- gophers-0.0.1/go_module/gophers.h +81 -0
- gophers-0.0.1/go_module/gophers.so +0 -0
- gophers-0.0.1/gophers/LICENSE +23 -0
- gophers-0.0.1/gophers/README.md +6 -0
- gophers-0.0.1/gophers/__init__.py +4 -0
- gophers-0.0.1/gophers/__main__.py +8 -0
- gophers-0.0.1/gophers/go_module/go.mod +3 -0
- gophers-0.0.1/gophers/go_module/gophers.go +18 -0
- gophers-0.0.1/gophers/go_module/gophers.h +81 -0
- gophers-0.0.1/gophers/go_module/gophers.so +0 -0
- gophers-0.0.1/gophers/gophers.py +29 -0
- gophers-0.0.1/gophers/pyproject.toml +90 -0
- gophers-0.0.1/gophers/requirements.txt +0 -0
- gophers-0.0.1/gophers.py +29 -0
- gophers-0.0.1/pyproject.toml +90 -0
- gophers-0.0.1/requirements.txt +0 -0
gophers-0.0.1/.gitignore
ADDED
gophers-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2022 SPEARTECH
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
23
|
+
|
gophers-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gophers
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: A small example package
|
|
5
|
+
Project-URL: Homepage, https://github.com/speartech/gophers
|
|
6
|
+
Project-URL: Issues, https://github.com/speartech/gophers/issues
|
|
7
|
+
Author-email: Example Author <tyler@speartech.org>
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >=3.11
|
|
13
|
+
Requires-Dist: annotated-types==0.7.0
|
|
14
|
+
Requires-Dist: anyio==4.8.0
|
|
15
|
+
Requires-Dist: asgiref==3.8.1
|
|
16
|
+
Requires-Dist: blinker==1.8.2
|
|
17
|
+
Requires-Dist: build==1.2.2
|
|
18
|
+
Requires-Dist: certifi==2024.7.4
|
|
19
|
+
Requires-Dist: cffi==1.16.0
|
|
20
|
+
Requires-Dist: chardet==5.2.0
|
|
21
|
+
Requires-Dist: charset-normalizer==3.3.2
|
|
22
|
+
Requires-Dist: click==8.1.7
|
|
23
|
+
Requires-Dist: colorama==0.4.6
|
|
24
|
+
Requires-Dist: cryptography==43.0.0
|
|
25
|
+
Requires-Dist: cython==3.0.11
|
|
26
|
+
Requires-Dist: defusedxml==0.8.0rc2
|
|
27
|
+
Requires-Dist: django-cors-headers==4.4.0
|
|
28
|
+
Requires-Dist: django-templated-mail==1.1.1
|
|
29
|
+
Requires-Dist: django==5.0.7
|
|
30
|
+
Requires-Dist: djangorestframework-simplejwt==5.3.1
|
|
31
|
+
Requires-Dist: djangorestframework==3.15.2
|
|
32
|
+
Requires-Dist: djoser==2.2.3
|
|
33
|
+
Requires-Dist: fastapi==0.115.8
|
|
34
|
+
Requires-Dist: flask==3.0.3
|
|
35
|
+
Requires-Dist: gupy-framework==0.3.2
|
|
36
|
+
Requires-Dist: h11==0.14.0
|
|
37
|
+
Requires-Dist: idna==3.7
|
|
38
|
+
Requires-Dist: itsdangerous==2.2.0
|
|
39
|
+
Requires-Dist: jinja2==3.1.4
|
|
40
|
+
Requires-Dist: markupsafe==2.1.5
|
|
41
|
+
Requires-Dist: oauthlib==3.2.2
|
|
42
|
+
Requires-Dist: packaging==24.1
|
|
43
|
+
Requires-Dist: pkginfo==1.12.0
|
|
44
|
+
Requires-Dist: pycparser==2.22
|
|
45
|
+
Requires-Dist: pydantic-core==2.27.2
|
|
46
|
+
Requires-Dist: pydantic==2.10.6
|
|
47
|
+
Requires-Dist: pyjwt==2.9.0
|
|
48
|
+
Requires-Dist: pyproject-hooks==1.2.0
|
|
49
|
+
Requires-Dist: python3-openid==3.2.0
|
|
50
|
+
Requires-Dist: requests-oauthlib==2.0.0
|
|
51
|
+
Requires-Dist: requests==2.32.3
|
|
52
|
+
Requires-Dist: screeninfo==0.8.1
|
|
53
|
+
Requires-Dist: setuptools==75.1.0
|
|
54
|
+
Requires-Dist: sniffio==1.3.1
|
|
55
|
+
Requires-Dist: social-auth-app-django==5.4.2
|
|
56
|
+
Requires-Dist: social-auth-core==4.5.4
|
|
57
|
+
Requires-Dist: sqlparse==0.5.1
|
|
58
|
+
Requires-Dist: starlette==0.45.3
|
|
59
|
+
Requires-Dist: typing-extensions==4.12.2
|
|
60
|
+
Requires-Dist: tzdata==2024.1
|
|
61
|
+
Requires-Dist: urllib3==2.2.2
|
|
62
|
+
Requires-Dist: uvicorn==0.34.0
|
|
63
|
+
Requires-Dist: werkzeug==3.0.3
|
|
64
|
+
Description-Content-Type: text/markdown
|
|
65
|
+
|
|
66
|
+
# Gophers
|
|
67
|
+
|
|
68
|
+
## The Go dataframe library - available as python & javascript (wasm) packages.
|
|
69
|
+
|
|
70
|
+
## Install the python package
|
|
71
|
+
### python -m pip install gophers
|
gophers-0.0.1/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* Code generated by cmd/cgo; DO NOT EDIT. */
|
|
2
|
+
|
|
3
|
+
/* package command-line-arguments */
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
#line 1 "cgo-builtin-export-prolog"
|
|
7
|
+
|
|
8
|
+
#include <stddef.h>
|
|
9
|
+
|
|
10
|
+
#ifndef GO_CGO_EXPORT_PROLOGUE_H
|
|
11
|
+
#define GO_CGO_EXPORT_PROLOGUE_H
|
|
12
|
+
|
|
13
|
+
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
|
14
|
+
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
/* Start of preamble from import "C" comments. */
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/* End of preamble from import "C" comments. */
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/* Start of boilerplate cgo prologue. */
|
|
28
|
+
#line 1 "cgo-gcc-export-header-prolog"
|
|
29
|
+
|
|
30
|
+
#ifndef GO_CGO_PROLOGUE_H
|
|
31
|
+
#define GO_CGO_PROLOGUE_H
|
|
32
|
+
|
|
33
|
+
typedef signed char GoInt8;
|
|
34
|
+
typedef unsigned char GoUint8;
|
|
35
|
+
typedef short GoInt16;
|
|
36
|
+
typedef unsigned short GoUint16;
|
|
37
|
+
typedef int GoInt32;
|
|
38
|
+
typedef unsigned int GoUint32;
|
|
39
|
+
typedef long long GoInt64;
|
|
40
|
+
typedef unsigned long long GoUint64;
|
|
41
|
+
typedef GoInt64 GoInt;
|
|
42
|
+
typedef GoUint64 GoUint;
|
|
43
|
+
typedef size_t GoUintptr;
|
|
44
|
+
typedef float GoFloat32;
|
|
45
|
+
typedef double GoFloat64;
|
|
46
|
+
#ifdef _MSC_VER
|
|
47
|
+
#include <complex.h>
|
|
48
|
+
typedef _Fcomplex GoComplex64;
|
|
49
|
+
typedef _Dcomplex GoComplex128;
|
|
50
|
+
#else
|
|
51
|
+
typedef float _Complex GoComplex64;
|
|
52
|
+
typedef double _Complex GoComplex128;
|
|
53
|
+
#endif
|
|
54
|
+
|
|
55
|
+
/*
|
|
56
|
+
static assertion to make sure the file is being used on architecture
|
|
57
|
+
at least with matching size of GoInt.
|
|
58
|
+
*/
|
|
59
|
+
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
|
|
60
|
+
|
|
61
|
+
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
|
62
|
+
typedef _GoString_ GoString;
|
|
63
|
+
#endif
|
|
64
|
+
typedef void *GoMap;
|
|
65
|
+
typedef void *GoChan;
|
|
66
|
+
typedef struct { void *t; void *v; } GoInterface;
|
|
67
|
+
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
|
|
68
|
+
|
|
69
|
+
#endif
|
|
70
|
+
|
|
71
|
+
/* End of boilerplate cgo prologue. */
|
|
72
|
+
|
|
73
|
+
#ifdef __cplusplus
|
|
74
|
+
extern "C" {
|
|
75
|
+
#endif
|
|
76
|
+
|
|
77
|
+
extern __declspec(dllexport) char* go_module();
|
|
78
|
+
|
|
79
|
+
#ifdef __cplusplus
|
|
80
|
+
}
|
|
81
|
+
#endif
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2022 SPEARTECH
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
23
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* Code generated by cmd/cgo; DO NOT EDIT. */
|
|
2
|
+
|
|
3
|
+
/* package command-line-arguments */
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
#line 1 "cgo-builtin-export-prolog"
|
|
7
|
+
|
|
8
|
+
#include <stddef.h>
|
|
9
|
+
|
|
10
|
+
#ifndef GO_CGO_EXPORT_PROLOGUE_H
|
|
11
|
+
#define GO_CGO_EXPORT_PROLOGUE_H
|
|
12
|
+
|
|
13
|
+
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
|
14
|
+
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
/* Start of preamble from import "C" comments. */
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/* End of preamble from import "C" comments. */
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/* Start of boilerplate cgo prologue. */
|
|
28
|
+
#line 1 "cgo-gcc-export-header-prolog"
|
|
29
|
+
|
|
30
|
+
#ifndef GO_CGO_PROLOGUE_H
|
|
31
|
+
#define GO_CGO_PROLOGUE_H
|
|
32
|
+
|
|
33
|
+
typedef signed char GoInt8;
|
|
34
|
+
typedef unsigned char GoUint8;
|
|
35
|
+
typedef short GoInt16;
|
|
36
|
+
typedef unsigned short GoUint16;
|
|
37
|
+
typedef int GoInt32;
|
|
38
|
+
typedef unsigned int GoUint32;
|
|
39
|
+
typedef long long GoInt64;
|
|
40
|
+
typedef unsigned long long GoUint64;
|
|
41
|
+
typedef GoInt64 GoInt;
|
|
42
|
+
typedef GoUint64 GoUint;
|
|
43
|
+
typedef size_t GoUintptr;
|
|
44
|
+
typedef float GoFloat32;
|
|
45
|
+
typedef double GoFloat64;
|
|
46
|
+
#ifdef _MSC_VER
|
|
47
|
+
#include <complex.h>
|
|
48
|
+
typedef _Fcomplex GoComplex64;
|
|
49
|
+
typedef _Dcomplex GoComplex128;
|
|
50
|
+
#else
|
|
51
|
+
typedef float _Complex GoComplex64;
|
|
52
|
+
typedef double _Complex GoComplex128;
|
|
53
|
+
#endif
|
|
54
|
+
|
|
55
|
+
/*
|
|
56
|
+
static assertion to make sure the file is being used on architecture
|
|
57
|
+
at least with matching size of GoInt.
|
|
58
|
+
*/
|
|
59
|
+
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];
|
|
60
|
+
|
|
61
|
+
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
|
62
|
+
typedef _GoString_ GoString;
|
|
63
|
+
#endif
|
|
64
|
+
typedef void *GoMap;
|
|
65
|
+
typedef void *GoChan;
|
|
66
|
+
typedef struct { void *t; void *v; } GoInterface;
|
|
67
|
+
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
|
|
68
|
+
|
|
69
|
+
#endif
|
|
70
|
+
|
|
71
|
+
/* End of boilerplate cgo prologue. */
|
|
72
|
+
|
|
73
|
+
#ifdef __cplusplus
|
|
74
|
+
extern "C" {
|
|
75
|
+
#endif
|
|
76
|
+
|
|
77
|
+
extern __declspec(dllexport) char* go_module();
|
|
78
|
+
|
|
79
|
+
#ifdef __cplusplus
|
|
80
|
+
}
|
|
81
|
+
#endif
|
|
Binary file
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#read from go module
|
|
2
|
+
from ctypes import cdll, c_char_p
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def main():
|
|
8
|
+
# Example for calling from Go package and returning results
|
|
9
|
+
path = os.path.dirname(os.path.realpath(__file__))
|
|
10
|
+
|
|
11
|
+
# Load the shared library
|
|
12
|
+
try:
|
|
13
|
+
gophers = cdll.LoadLibrary(path+'/go_module/gophers.so')
|
|
14
|
+
except Exception as e:
|
|
15
|
+
print(str(e))
|
|
16
|
+
return
|
|
17
|
+
|
|
18
|
+
# Define the return type of the function
|
|
19
|
+
gophers.go_module.restype = c_char_p
|
|
20
|
+
|
|
21
|
+
go_message = gophers.go_module().decode('utf-8')
|
|
22
|
+
print(go_message)
|
|
23
|
+
|
|
24
|
+
return go_message
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
if __name__ == '__main__':
|
|
28
|
+
main()
|
|
29
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
|
|
2
|
+
[build-system]
|
|
3
|
+
requires = ["hatchling"]
|
|
4
|
+
build-backend = "hatchling.build"
|
|
5
|
+
|
|
6
|
+
[project]
|
|
7
|
+
name = "gophers"
|
|
8
|
+
version = "0.0.1"
|
|
9
|
+
authors = [
|
|
10
|
+
{ name="Example Author", email="tyler@speartech.org" },
|
|
11
|
+
]
|
|
12
|
+
description = "A small example package"
|
|
13
|
+
readme = "README.md"
|
|
14
|
+
requires-python = ">=3.11"
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
# Add your dependencies here
|
|
22
|
+
dependencies = [
|
|
23
|
+
"annotated-types==0.7.0",
|
|
24
|
+
"anyio==4.8.0",
|
|
25
|
+
"asgiref==3.8.1",
|
|
26
|
+
"blinker==1.8.2",
|
|
27
|
+
"build==1.2.2",
|
|
28
|
+
"certifi==2024.7.4",
|
|
29
|
+
"cffi==1.16.0",
|
|
30
|
+
"chardet==5.2.0",
|
|
31
|
+
"charset-normalizer==3.3.2",
|
|
32
|
+
"click==8.1.7",
|
|
33
|
+
"colorama==0.4.6",
|
|
34
|
+
"cryptography==43.0.0",
|
|
35
|
+
"Cython==3.0.11",
|
|
36
|
+
"defusedxml==0.8.0rc2",
|
|
37
|
+
"Django==5.0.7",
|
|
38
|
+
"django-cors-headers==4.4.0",
|
|
39
|
+
"django-templated-mail==1.1.1",
|
|
40
|
+
"djangorestframework==3.15.2",
|
|
41
|
+
"djangorestframework-simplejwt==5.3.1",
|
|
42
|
+
"djoser==2.2.3",
|
|
43
|
+
"fastapi==0.115.8",
|
|
44
|
+
"Flask==3.0.3",
|
|
45
|
+
"gupy-framework==0.3.2",
|
|
46
|
+
"h11==0.14.0",
|
|
47
|
+
"idna==3.7",
|
|
48
|
+
"itsdangerous==2.2.0",
|
|
49
|
+
"Jinja2==3.1.4",
|
|
50
|
+
"MarkupSafe==2.1.5",
|
|
51
|
+
"oauthlib==3.2.2",
|
|
52
|
+
"packaging==24.1",
|
|
53
|
+
"pkginfo==1.12.0",
|
|
54
|
+
"pycparser==2.22",
|
|
55
|
+
"pydantic==2.10.6",
|
|
56
|
+
"pydantic_core==2.27.2",
|
|
57
|
+
"PyJWT==2.9.0",
|
|
58
|
+
"pyproject_hooks==1.2.0",
|
|
59
|
+
"python3-openid==3.2.0",
|
|
60
|
+
"requests==2.32.3",
|
|
61
|
+
"requests-oauthlib==2.0.0",
|
|
62
|
+
"screeninfo==0.8.1",
|
|
63
|
+
"setuptools==75.1.0",
|
|
64
|
+
"sniffio==1.3.1",
|
|
65
|
+
"social-auth-app-django==5.4.2",
|
|
66
|
+
"social-auth-core==4.5.4",
|
|
67
|
+
"sqlparse==0.5.1",
|
|
68
|
+
"starlette==0.45.3",
|
|
69
|
+
"typing_extensions==4.12.2",
|
|
70
|
+
"tzdata==2024.1",
|
|
71
|
+
"urllib3==2.2.2",
|
|
72
|
+
"uvicorn==0.34.0",
|
|
73
|
+
"Werkzeug==3.0.3"
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
[project.urls]
|
|
77
|
+
Homepage = "https://github.com/speartech/gophers"
|
|
78
|
+
Issues = "https://github.com/speartech/gophers/issues"
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# Specify the directory where your Python package code is located
|
|
82
|
+
[tool.hatch.build.targets.sdist]
|
|
83
|
+
include = ["*"]
|
|
84
|
+
|
|
85
|
+
[tool.hatch.build.targets.wheel]
|
|
86
|
+
include = ["*"]
|
|
87
|
+
|
|
88
|
+
# Define entry points for CLI
|
|
89
|
+
[project.scripts]
|
|
90
|
+
gophers = "gophers.__main__:main"
|
|
Binary file
|
gophers-0.0.1/gophers.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#read from go module
|
|
2
|
+
from ctypes import cdll, c_char_p
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def main():
|
|
8
|
+
# Example for calling from Go package and returning results
|
|
9
|
+
path = os.path.dirname(os.path.realpath(__file__))
|
|
10
|
+
|
|
11
|
+
# Load the shared library
|
|
12
|
+
try:
|
|
13
|
+
gophers = cdll.LoadLibrary(path+'/go_module/gophers.so')
|
|
14
|
+
except Exception as e:
|
|
15
|
+
print(str(e))
|
|
16
|
+
return
|
|
17
|
+
|
|
18
|
+
# Define the return type of the function
|
|
19
|
+
gophers.go_module.restype = c_char_p
|
|
20
|
+
|
|
21
|
+
go_message = gophers.go_module().decode('utf-8')
|
|
22
|
+
print(go_message)
|
|
23
|
+
|
|
24
|
+
return go_message
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
if __name__ == '__main__':
|
|
28
|
+
main()
|
|
29
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
|
|
2
|
+
[build-system]
|
|
3
|
+
requires = ["hatchling"]
|
|
4
|
+
build-backend = "hatchling.build"
|
|
5
|
+
|
|
6
|
+
[project]
|
|
7
|
+
name = "gophers"
|
|
8
|
+
version = "0.0.1"
|
|
9
|
+
authors = [
|
|
10
|
+
{ name="Example Author", email="tyler@speartech.org" },
|
|
11
|
+
]
|
|
12
|
+
description = "A small example package"
|
|
13
|
+
readme = "README.md"
|
|
14
|
+
requires-python = ">=3.11"
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
# Add your dependencies here
|
|
22
|
+
dependencies = [
|
|
23
|
+
"annotated-types==0.7.0",
|
|
24
|
+
"anyio==4.8.0",
|
|
25
|
+
"asgiref==3.8.1",
|
|
26
|
+
"blinker==1.8.2",
|
|
27
|
+
"build==1.2.2",
|
|
28
|
+
"certifi==2024.7.4",
|
|
29
|
+
"cffi==1.16.0",
|
|
30
|
+
"chardet==5.2.0",
|
|
31
|
+
"charset-normalizer==3.3.2",
|
|
32
|
+
"click==8.1.7",
|
|
33
|
+
"colorama==0.4.6",
|
|
34
|
+
"cryptography==43.0.0",
|
|
35
|
+
"Cython==3.0.11",
|
|
36
|
+
"defusedxml==0.8.0rc2",
|
|
37
|
+
"Django==5.0.7",
|
|
38
|
+
"django-cors-headers==4.4.0",
|
|
39
|
+
"django-templated-mail==1.1.1",
|
|
40
|
+
"djangorestframework==3.15.2",
|
|
41
|
+
"djangorestframework-simplejwt==5.3.1",
|
|
42
|
+
"djoser==2.2.3",
|
|
43
|
+
"fastapi==0.115.8",
|
|
44
|
+
"Flask==3.0.3",
|
|
45
|
+
"gupy-framework==0.3.2",
|
|
46
|
+
"h11==0.14.0",
|
|
47
|
+
"idna==3.7",
|
|
48
|
+
"itsdangerous==2.2.0",
|
|
49
|
+
"Jinja2==3.1.4",
|
|
50
|
+
"MarkupSafe==2.1.5",
|
|
51
|
+
"oauthlib==3.2.2",
|
|
52
|
+
"packaging==24.1",
|
|
53
|
+
"pkginfo==1.12.0",
|
|
54
|
+
"pycparser==2.22",
|
|
55
|
+
"pydantic==2.10.6",
|
|
56
|
+
"pydantic_core==2.27.2",
|
|
57
|
+
"PyJWT==2.9.0",
|
|
58
|
+
"pyproject_hooks==1.2.0",
|
|
59
|
+
"python3-openid==3.2.0",
|
|
60
|
+
"requests==2.32.3",
|
|
61
|
+
"requests-oauthlib==2.0.0",
|
|
62
|
+
"screeninfo==0.8.1",
|
|
63
|
+
"setuptools==75.1.0",
|
|
64
|
+
"sniffio==1.3.1",
|
|
65
|
+
"social-auth-app-django==5.4.2",
|
|
66
|
+
"social-auth-core==4.5.4",
|
|
67
|
+
"sqlparse==0.5.1",
|
|
68
|
+
"starlette==0.45.3",
|
|
69
|
+
"typing_extensions==4.12.2",
|
|
70
|
+
"tzdata==2024.1",
|
|
71
|
+
"urllib3==2.2.2",
|
|
72
|
+
"uvicorn==0.34.0",
|
|
73
|
+
"Werkzeug==3.0.3"
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
[project.urls]
|
|
77
|
+
Homepage = "https://github.com/speartech/gophers"
|
|
78
|
+
Issues = "https://github.com/speartech/gophers/issues"
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# Specify the directory where your Python package code is located
|
|
82
|
+
[tool.hatch.build.targets.sdist]
|
|
83
|
+
include = ["*"]
|
|
84
|
+
|
|
85
|
+
[tool.hatch.build.targets.wheel]
|
|
86
|
+
include = ["*"]
|
|
87
|
+
|
|
88
|
+
# Define entry points for CLI
|
|
89
|
+
[project.scripts]
|
|
90
|
+
gophers = "gophers.__main__:main"
|
|
Binary file
|