Giter VIP home page Giter VIP logo

sws's Introduction

sws-banner

Table of Contents

Super Web Scripts

A command line interface, and set of scripts for common web tasks.

Quick-start

Installation

From PyPi

run pip install sws or sudo pip3 install sws.

From source

  1. Clone the github repo (https://github.com/Descent098/sws)
  2. cd into the 'sws' root directory (where setup.py is) and run pip install . or sudo pip3 install .

Additional Documentation

API Documentation can be found at https://kieranwood.ca/sws/

User Documentation for the cli can be found at https://sws.readthedocs.io

What does sws do?

sws is both a cli, and an API with the goal of making common web development tasks simple.

Specifically the API is designed to:

  1. Be a cross-platform utility API
  2. Give sensible high-level functions for common tasks
  3. Provide useful constants such as a list of dns record types
  4. Provide a set of utility classes for common tasks (such as downloads)

The CLI is designed to:

  1. Provide a cross-platform set of tools
  2. Provide a toolbox for ease of use tasks so you don't need to know dozens of commands
  3. Make doing simple tasks simpler

Features & Roadmap

Domain names

Get information about domain names including:

  • Who is the registrar
  • When the domain expires

Redirects

Get information about the trace of http redirects

SSL

Get deails about the ssl cert of a hostname such as:

  • When the cert will expire
  • The issuer of the cert
  • A full dict of the details of the cert

YouTube

Allows for the download of videos as well as geting metadata

dns

Prints a table of the DNS records for a given domain

Roadmap

A full roadmap for each project version can be found here: https://github.com/Descent098/sws/projects

Why should I use sws?

The best marketing pitch that I can give you is that it's easy to use, free, and open source. The project really is here so that people don't have to keep writing the same implementations of basic tasks, and can instead use a tested package that contains a ton of functionality. Additionally if you don't want to use all of sws's features, because it is MIT liscenced you can feel free to vendor functions within your own project.

Who is sws for?

Really it can be used by anyone, but here are the most typial use cases:

  • Web developers; tools provided in sws can help with debugging and validating web servers
  • Devops Specialists & testers; can use sws api to automate validation that servers are running how they should be
  • People learning webdev; Sometimes getting access to tooling while learning webdev can be difficult, this can be a one-stop shop for lots of functionality
  • Scripters; people who are looking to use sws functionality in their own projects

Development-Contribution guide

See Contribution guide for details about helping with development.

sws's People

Contributors

descent098 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

sws's Issues

Fix `domains -d` response

Currently using sws domains kieranwood.ca -d prints:

{'creation_date': datetime.datetime(2018, 11, 6, 5, 9, 47),
 'expiration_date': datetime.datetime(2022, 11, 6, 5, 9, 47),
 'last_updated': datetime.datetime(2020, 11, 7, 14, 52, 12),
 'name': 'kieranwood.ca',
 'name_servers': {'sharon.ns.cloudflare.com', 'kevin.ns.cloudflare.com'},
 'registrant_cc': 'redacted for privacy',
 'registrar': 'Go Daddy Domains Canada, Inc'}

The datetime objects in 'creation_date', 'expiration_date', 'last_updated' should be converted to human-readable formats.

TODO

  • When printing the response in the CLI convert the datetime objects to a human-readable format
  • Update User docs example with new print format

update readme

  • Review old section wording since much of it is awkward
  • Add docs for new commands
    • Loadtest
    • Framework
  • Move installation instructions up

Add a glossary

Definitions

  • SSL
  • Domain
  • FQDN
  • Framework
  • Registrar
  • Metadata

add downloads module

Requirements

  • Download class
    • url
    • size
    • download() with progress bar option
    • extension
    • download path

loadtest Command

Implement a loadtesting command to loadtest a framework

Requirements

  • Use Locust
  • Provide URL
  • Passthrough the loadtesting FE

more error catching

Tasks

  • See if it's possible to inject into PATH variable for whois instead of registry modification

Implement domains command

Used to get domain info

Functionality

  • Expiry
  • Registered to
  • Contact info
  • If available
  • If other TLD's are available

update user docs

  • Update index wording, since some of it is awkward due to refactoring
  • Add docs for new commands
    • Loadtest
    • Framework
  • Cleanup Contribution guide
  • Add API cookbook

framework command

Checks if a site is a popular framework

Requirements

  • Pass in url that goes through set of checks to see if site is using known frameworks
  • Need to have Heirarchy for UI frameworks (bulma, jquery, react, bootstrap etc.), proxy systems (Nginx, apache etc.), backend frameworks (Wordpress, Drupal, squarespace, wix, django etc.)
  • On query return an ordered list with the likelyhoods of each being present

So something like this:

sws frameworks kieranwood.ca

would print

Framework analysis for https://kieranwood.ca

Backend
======
1. Django (x/10 checks)

UI
=======
1. Bootstrap
2. JQuery

Proxy
====
1. NGINX

Add Validation module

The purpose of this module is to provide easy ways to validate strings are in the correct format for use.

TODO

  • Create a validation class that can take in a regex string, and has 2 methods: __repr__(), validate()
  • Add in the instances found in the Validation instances section

Validation class

import re
from dataclasses import dataclass

@dataclass
class Validator:
    validation_string:str

    def validate(self, value:str, as_bool:bool=False) -> :
        compiled_expression = re.compile(self.validation_string)
        if not as_bool:
            return compiled_expression.match(value) # Return full match groups
        else:
            return bool(compiled_expression.match(value))

    def __repr__(self) ->str:
        return self.validation_string

Validation instances

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.