1.1.12 • Published 12 months ago

pequena v1.1.12

Weekly downloads
-
License
MIT
Repository
-
Last release
12 months ago

Pequena

Pequena is a desktop creation framework that allows you to create desktop applications using web technologies such as HTML, CSS, and JavaScript. It is built on top of the webview library for Python. It is supposed to be lightweight and easy to use, while keeping all the complex stuff.

Visit website:Pequena

Installation

Pequena can be installed using npm

npm install pequena

Usage

After the installation, main.py and settings.json should appear in your root folder together with Pequena/ folder. Main.py content should look like this:

import Pequena

window = Pequena.init_window()

Go to the settings.json and change the src attribute to an actual client directory and you are ready to go! Default value is ./client/index.html PS: Index.html has to be in another folder than main.py. So I highly recommend using client/ directory where all your frontend lives.

Running the app

Now you can run your app using

npm run start

The first run will take longer as it creates a virtual enviroment for the python to achieve minimal size.

Or you can use hot-reload functionality

npm run dev

Exposing functions

You can expose Python functions to your client-side JavaScript code by using the expose_functions function:

def my_function():
    return "Hello, World!"
Pequena.expose_functions(my_function)

In your client-side JavaScript code, you can then call the Python Pequena function using the __Exposed__ object:

const result = await __Exposed__.my_function();

In your client-side JavaScript code, you also access the Node object itself using the __Node__ object:

const file = await __Node__.fs.readFile("./hello.txt");

There are some prebuilt ones: fs.readFile, fs.writeFile, fs.mkdir, fs.readdir, fs.pathExists, fs.isfile, fs.isdir, path.join, path.basename, path.dirname, path.resolve. More of them is comming soon with a better documentation.

Compiling

To compile the app pequena uses pyinstaller. The script in package.json comes with default settings which should work optimaly. So you can run this command:

npm run build

A single binary file will be created in dist/ folder.

Compiling to mobile apps is comming! But it will propably take a while. But you can definitely help!!

Contributing

Contributions are always welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the Github-publisher repository.

I will be very glad for any kind of feedback!

License

Pequena is licensed under the MIT License.

1.1.1

12 months ago

1.1.0

12 months ago

1.1.9

12 months ago

1.1.8

12 months ago

1.1.7

12 months ago

1.1.6

12 months ago

1.1.5

12 months ago

1.1.4

12 months ago

1.1.3

12 months ago

1.1.2

12 months ago

1.1.12

12 months ago

1.1.11

12 months ago

1.1.10

12 months ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.40

1 year ago

1.0.44

1 year ago

1.0.22

1 year ago

1.0.43

1 year ago

1.0.21

1 year ago

1.0.42

1 year ago

1.0.20

1 year ago

1.0.41

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.45

1 year ago

1.0.23

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago