2021-06-04 Python keynote + decp-info + sphinx doc

Django news 78

TailwindCSS

Django-htmx 1.1.0 (2021-06-03)

KEYNOTE / Python Steering Council / C. Willing, T. Wouters, B. Cannon, P. Galindo Salgado, B. Warsaw

https://teamopendata.org/t/decp-info-les-donnees-de-la-commande-publique-pour-tous-questions-reponses-discussions/2948

Bienvenue !

Ce fil a pour objectif de recueillir les questions et commentaires relatifs à l’application https://decp.info/ :

  • utilisation

  • production des données

  • schéma Table Schema

  • personnalisation de datasette

  • suggestions de fonctionnalités (Github c’est bien aussi)

  • etc.

Les questions les plus évidentes/fréquentes seront rassemblées dans ce post pour plus de visibilité.

Le retours de bugs sont aussi les bienvenus, mais ils ont plus leur place dans les issues sur Github. Si vous déclarez un bug ici, je le créerai dans Github et l’inscrirai dans ce post.

J’ai publié une vidéo de démonstration qui vous aidera à prendre l’outil en main et à en tirer le meilleur !

Qu’est-ce que decp.info ?

DECP est l’acronyme de Données Essentielles de la Commande Publique.

Il s’agit des données que les acheteurs publics (communes, départements, régions, préfectures, hôpitaux publics, ministères, etc.) doivent publier selon les termes de l’arrêté du 22 mars 2019.

Plus précisément, il s’agit des données sur l’attribution des marchés publics (quel acheteur public a acheté quoi, à qui, quand et pour quel montant). Ce site officiel 7 résume bien ce que sont les DECP et le contexte.

Avant decp.info, ces données n’étaient disponibles qu’aux formats JSON et XML.

Ces formats autorisent une structure et donc une sémantique plus riche, mais ils sont également difficiles à manipuler sans utiliser des logiciels pointus.

J’ai donc :

  • développé un schéma tabulaire 5 selon les standards en vigueur (Table Schema 2)

  • développé un script de transformation 1 basé sur la bibliothèque Python dataflows

  • transformé les DECP consolidées officelles 4 du format JSON vers le format format CSV et publié le résultat sur data.gouv.fr 4 (les données sont mises à jour quotidiennement)

  • développé une interface d’exploration, tri, filtrage et téléchargement des données au format CSV ou XLSX (Excel), basée sur datasette et accessible sur decp.info

Java et htmx

Full Stack Java In 2021

In this talk, we will examine strategies for full-stack web development in Java in 2021.

The presentation focuses on how to tackle the front-end from the perspective of a server-side Java developer.

We will look at how a solo full-stack developer can leverage simple new frameworks to create rich, highly responsive, dynamic web applications - and how to scale those applications for larger teams.

In this session we will compare and contrast frameworks such as React with light-weight client-side frameworks such as htmx and Alpine.js.

We’ll look in particular detail at how modern HTML, CSS, and JavaScript can be combined with Java to build highly performant rich applications in a simple, easy-to-use system without a JavaScript toolchain – no Node.js, npm, Babel, virtual DOM, etc. required.

Code examples in this session will be provided using Spring Boot and Maven, but are conceptually easy to translate to other server-side frameworks.

Much of this session also applies to any server-side platform – invite your Python/Django, Ruby on Rails, and other server-side developer friends!

Some of the topics covered include:

  • Compare & contrast React with htmx and Alpine.js

  • Consider Canvas+WebGL+Web Assembly vs HTML/DOM vs Virtual DOM-based frameworks

  • What happened with GWT, JSF, and why the industry keeps inventing new JavaScript frameworks

  • Using WebJars to use JavaScript libraries published to npm.

  • Carefully considering rendering and caching throughout Spring Boot layers

  • Discuss scaling team size and roles with different frameworks

  • Tools for incrementally adding web development complexity to a Maven-based project

  • Options for releasing a Java-based web application as a desktop and/or mobile app.

Speaker: Will Iverson has been a frequent speaker at SeaJUG for over a decade. Will has been working in the computer and information technology field professionally since 1990.

His diverse background includes developing statistical applications to analyze data from the NASA Space Shuttle, product management for Apple, and developer relations for Symantec’s Visual Cafe. Consulting clients over the last two decades include Sun, BEA, Canal+ Technologies, AT&T, T-Mobile, the State of Washington, and many, many more.

From 2010-2016 Will was co-founder and CTO for Dev9, a premier Seattle consulting firm (acquired by Nortal in 2018). From 2017-2020 Will worked on video games, culminating in the release of BlazeSky in 2020.

New Sphinx tutorial for beginners #9165

Djangocon Europe

Building Django out of existing (mostly django-inspired!) components Tête qui explose: @EmmaDelescolle's
excellent talk: "Rewriting Django from (almost) scratch in 2021" at @DjangoConEurope
 #djangocon

https://github.com/David-Wobrock

Migrations and understanding Django’s relationship with its database » by @davidwobrock dives deep into the #Django #migration framework and aims to shares tips for dealing with various migration issues

Building a Markdown summary of Django group permissions

Django SQL Dashboard can display rendered markdown generated by a SQL query.

Here’s a query I figured out today for showing a summary of all Django groups, their members and the list of permissions those groups hold:

select
  (
    '# ' || (
      select
        name
      from
        auth_group
      where
        id = auth_group_original.id
    ) || '

' || (
      select
        count(*)
      from
        auth_user_groups
      where
        auth_user_groups.group_id = auth_group_original.id
    ) || ' members:

' || (
      select
        string_agg(auth_user.username, ', ')
      from
        auth_user
        join auth_user_groups on auth_user_groups.user_id = auth_user.id
      where
        auth_user_groups.group_id = auth_group_original.id
    ) || '

Permissions:

' || (
      select
        coalesce(
          string_agg(
            '* ' || auth_permission.name,
            '
'
          ),
          'None'
        )
      from
        auth_permission
        join auth_group_permissions on auth_group_permissions.permission_id = auth_permission.id
      where
        auth_group_permissions.group_id = auth_group_original.id
    )
  ) as markdown
from
  auth_group auth_group_original